Commit Graph

199 Commits

Author SHA1 Message Date
Andrew Borodin
0efb799db3 lib/mcconfig: fix coding style; apply source file template.
Unconstify some function arguments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-01 19:41:12 +03:00
Andrew Borodin
01a1a01d4e Rename VFS module initialization functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-06-15 17:43:00 +03:00
Andrew Borodin
7d80e8a175 Always use vfs_s_subclass as base class for VFS modules.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-06-15 17:43:00 +03:00
Andrew Borodin
4f06ba9346 Ticket #3971: clarify sighandler_t usage in non-GNU OSes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-06-15 09:38:53 +03:00
Andrew Borodin
3e08cc7226 VFS: derive VFS-specific super class from vfs_s_super.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
d51f1f4963 VFS: refactor VFS unit initialization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
672ba46c8b VFS: make vfs_class and vfs_s_subclass related macros more readable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
0fbd98fece Join vfs_class_flags_t and vfs_subclass_flags_t.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
c764d60238 VFS: (vfs_s_subclass): derive from vfs_class.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
f11c78f9d0 (vfs_unregister_class): new API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
c97893279c tests: fix comments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
acc0bbdfbf tests/lib/strutil/parse_integer.c: use macros, fix comments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
e1461bcfd3 tests: fix memory leaks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
d6ed25d143 tests: set up writable directory to allow create temporary files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
5454a1c740 Fix indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-03-10 11:55:45 +03:00
Andrew Borodin
a2a5fa017e Fix file version sort.
Use filevercmp() instead of str_verscmp().
Source code of filevercmp() is taken from Gnulib.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-03-02 11:24:07 +03:00
Andrew Borodin
2163009270 Ticket #3905, 3956: fix file version sort.
* Update str_verscmp implementation: sync with Gnulib.
  * Add tests. Testcases are taken from Gnulib.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-20 15:42:53 +03:00
Andrew Borodin
aa9d18e3ed (examine_cd): refactoring: use GString.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 12:47:59 +03:00
Andrew Borodin
1dd8a47987 Ticket #3955: code cleanup before 4.8.23 release.
Update copyright years.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 12:44:40 +03:00
Yury V. Zaytsev
b44bfee6bf Ticket #3789: remove faulty test in rpm helper to detect CONFLICTS tag
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2018-05-27 15:17:31 +02:00
Yury V. Zaytsev
b692136645 maint: fix test fixtures for extfs rpm helper (broken in 8d0c1c3)
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2018-05-27 15:00:38 +02:00
Andrew Borodin
ddd645526a Update copyright years. 2018-02-04 11:30:22 +03:00
Andrew Borodin
a38accd389 (mc_realpath): ignore path encoding.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
3ae7ad4449 tests: fix DSO link error in case of --enable-mclib.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Yury V. Zaytsev
f0414be51d Zero struct stat tv_nsec (if supported) whenever st is filled manually
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-05-17 21:18:58 +02:00
Mooffie
e2f5034303 Ticket #3786: extfs: rpm: fix test's "expected output".
As will be explained in a following commit, our rpm helper has a bug stemming
from the use of 'echo'.

Before we fix it, we update the test's "expected output" to reflect the
intended output (as it's currently reflects a faulty output).

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-03-09 01:03:34 +02:00
Mooffie
d0131271f3 Ticket #3787: extfs: tests for helpers using 'sort' may fail.
The "expected output" files we provide must be generated in the same locale the
tester (that is, the helpers) are run. Otherwise helpers using the 'sort'
utility may generate output different than our provided "expected output",
hence failing the tests.

Therefore we:

(1) Regenerate the "expected output" files in the C locale.

(2) Make sure the tester is run in the C locale.

(Tip: to regenerate the "expected output" files we deleted all the *.output
files and run the tester with "LC_ALL=C ./run --create-output".)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-03-08 14:01:46 +02:00
Mooffie
f782b037d8 extfs: tester: fix indentation.
No code is modified here. Only whitespace.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-03-08 11:34:09 +02:00
Mooffie
55624eae3b Ticket #3784: extfs: add diff output to tester.
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-03-07 23:57:35 +02:00
Yury V. Zaytsev
ab4fcb6d30 Revert "Ticket #3687: store the 'hotlist' file in data dir, not config dir."
This reverts commit 306b30ed30.
2017-02-24 21:32:01 +01:00
Andrew Borodin
e9fd11bfcd Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 19:12:55 +03:00
Mooffie
65299b8310 extfs: rpm: fix tests for transaction scripts.
We update our .output file to include the entries
`INFO/SCRIPTS/{PRE,POST}TRANS[PROG]`, which the rpm helper now emits.

(Tip: here's how we do this: we delete the output file and recreate it by
running the tester thus: "./run --create-output".)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 17:14:38 +02:00
Mooffie
a3b9b95c2d extfs: rpm: move misc/* to misc/rpm/*.
In the future we will probably place each helper's tests in a separate folder.
We'll then get rid of this 'misc/rpm' folder by moving it there.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
b10f34e898 extfs: rpm: add test for a custom package.
We use a 'spec' contributed by Jiri Tyr.

We keep the previous test (by renaming rpm.* to rpm.glib.*), though, in case
somebody wants to work on data from "the real world".

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
4b8785ead6 extfs: rpm: add tests.
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
e3cef7576b extfs: rpm: introduce the rpm2tags tool.
This is a preliminary step before being able to write tests for our rpm helper.

We introduce 'rpm2tags', a tool for converting RPM packages to parsable text
files. This will enable us to write tests that can run even where the 'rpm'
program isn't installed.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
69897e94fd Ticket #3753: extfs: tester: let test scripts easily access configure-time parameters.
We introduce a mechanism by which tests can easily access configure-time
parameters (like @PERL@, @AWK@, ...).

It works by "sourcing" a file named config.sh (residing in the build tree):

    . "$MC_TEST_EXTFS_CONFIG_SH"
    $PERL -e 'print "hello"'

(Although config.sh has a shell syntax, Perl and Python programs too can
benefit from it, because it can be sourced into an .env_vars file and the
values exported from there.)

Of course, one can also use the traditional method, of *.in files listed in
configure.ac, but the mechanism introduced here is a more comfortable approach.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-15 20:10:01 +02:00
Mooffie
f42bdb1261 extfs: tester: improve HTML documentation output.
- We now have 4'th level headers: adjust --doc-depth.
- We have many short sections: highlight the active section's header.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-15 19:43:45 +02:00
Mooffie
e4e4b214b4 extfs: tester: export some more useful variables.
New environment variables:

- MC_TEST_EXTFS_DATA_DIR
- MC_TEST_EXTFS_INPUT

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-15 19:43:40 +02:00
Mooffie
9f99838fbe Ticket #3752: extfs: tester: use lowercase for private variables.
We switch to a modern practice of using lowercase for private variables ("shell
variables") and uppercase for the system's ("environment variables"). Constants
too are made lowercase, as it takes a philosopher to define "constant".

This gives us two advantages:

- If an .env_vars file accesses a private variable (e.g. $DATA_DIR or $INPUT),
  something we want to discourage, we'll easily see this.

- Somewhat confusing code like "MC_TEST_DATA_DIR=$DATA_DIR" (which was to occur
  in the following patch) becomes self-documenting after the change.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-13 15:36:18 +02:00
Andrew Borodin
aae43d362f (vfs_adjust_stat): new VFS API, currently used to calculate st_blocks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
bf40acf420 Clarify usage of st_rdev. Use it if HAVE_STRUCT_STAT_ST_RDEV is defined.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
7e4a59e8d6 Clarify usage of st_blocks. Use it if HAVE_STRUCT_STAT_ST_BLOCKS is defined.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
8dabd9ac2a Ticket #3749: fix segfault in VFS if block size is not set.
Initial commit: clarify usage of st_blksize. Use it if
HAVE_STRUCT_STAT_ST_BLKSIZE is defined.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Mooffie
4a559344fb Ticket #3708: fix usability problems with --enable-tests
Signed-off-by: Mooffie <mooffie@gmail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-12-27 16:46:38 +04:00
Mooffie
d376f0ca43 extfs: hp48: add tests. 2016-12-25 10:06:23 +04:00
Mooffie
644682ad2c extfs: uarc: add tests. 2016-12-25 10:06:23 +04:00
Mooffie
0e4e80cf79 extfs: uace: add tests. 2016-12-25 10:06:23 +04:00
Mooffie
d4ec872f37 Ticket #3744: extfs: u7z: add tests. 2016-12-24 09:58:53 +04:00
Mooffie
2c17c7d28b Ticket #3730: extfs: don't run tester on "make check" if disabled.
If the extfs VFS is disabled, there's no point in building and running the
tester.

(The "SUBDIRS =" line isn't needed, but it looks tidier this way, especially if
we later add subdirs for testing the other VFSs.)

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-12-20 09:37:03 +03:00