To build: meson build && ninja -C build
To run tests: ninja -C build check
To install for packaging: DESTDIR=/var/tmp/inst ninja -C build install
To install for realz: sudo ninja -C build install
v2:
- Optional items are now based on the 'feature' feature in meson.
Built libraries which are disabled turn into disabler() objects
and also poison any executables which link to them.
What is there:
- building of the binaries and libs and the python module
- installation of binaries, libs, python module, localization files,
man pages, pkgconfig files
- running of tests
- most options to configure build equivalently to the
./configure settings
Partially implemented:
- disabling of stuff when things missing. In the C code, the defines
are all used, so that should be fine. In the build system, some
files should be skipped, but that is probably not always done properly.
Getting this right might require some testing of various build option
combinations to get the details right.
Not implemented:
- static builds of fdisk and other binaries
- things marked with XXX or FIXME
- ???
Differences:
- .la files are not created. They are useless and everybody hates them.
- Requires.private in pkgconfig files are not present in the
autogenerated .pc file. Not sure if they should be there or not. If
necessary, they can be added by hand.
- man pages and systemd units are installed by the install target. Not
sure why 'make install' doesn't do that.
- the split between / and /usr is probably wrong. But it's all pointless
anyway, so maybe we could simplify things but not implementing it at
all under meson?
The test would occasionally fail with
tests/run.sh: line 241: /home/fedora/util-linux/build/tests/failures: No such file or directory
I don't quite understand why the file does not get created... The outupt directory
missing seems the most likely explanation.
* don't enable parsable for non-parallel executions in travis
* add --parsable to run.sh
* use --parsable rather than TS_OPT_ in travis
Signed-off-by: Karel Zak <kzak@redhat.com>
sparc64 is reporting 128 as a total, but only 32 is online. So use only
online cpus for tests parallel runs.
$ nproc
32
$ nproc --all
128
$ lscpu
Architecture: sparc64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Big Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 8
Core(s) per socket: 4
Socket(s): 1
Model name: UltraSparc T5 (Niagara5)
Flags: sun4v
Signed-off-by: Anatoly Pugachev <matorola@gmail.com>
Let's detect ASAN LDFLAGS in top level Makefile to make sure we call
tests with --memcheck-asan if build-system has been configured with
--enable-asan.
Signed-off-by: Karel Zak <kzak@redhat.com>
The default is SKIP missing commands on --use-system-commands, but
with --noskip-commands the test will FAIL.
Signed-off-by: Karel Zak <kzak@redhat.com>
This change allows to use commands from $PATH rather than from
$top_builddir. There two basic use cases:
* check differences between installed and git version
run.sh --use-system-command --show-diff
* check system binaries by upstream tests (for example tests from
src.rpm package)
Signed-off-by: Karel Zak <kzak@redhat.com>
Fix shellcheck error.
if ! [ "$paraller_jobs" -ge 0 2>/dev/null ]; then
^-- SC1009: The mentioned parser error was in this if expression.
^-- SC1073: Couldn't parse this test expression.
^-- SC1072: Expected test to end here (don't
wrap commands in []/[[]]). Fix any
mentioned problems and try again.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The patch enables flock for scsi_debug to avoid collision between
tests. The patch also adds ./run.sh --nolocks to disable this feature.
Signed-off-by: Karel Zak <kzak@redhat.com>
The command ./configure --enable-asan adds -fsanitize=address
to the compiler command line. In the regression tests leaks detection
is disabled by default. You have to use --memcheck-asan on test
command line to enable.
Signed-off-by: Karel Zak <kzak@redhat.com>
This is to force the one-line results also for non-parallel case.
We are using it for travis auto-build and on other build farms.
Moreover you can set this (and any other) option globally by env
which is the only way to pass it to make distcheck.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This patch fixes several issues:
1. lscpu may not exist on all systems.
2. Option -b is not always available but we can skip it because it's
the documented default for -p.
3. Some old lscpu versions print --help output to stdout in case of
error. So in case 2. it would count all the help lines as CPUs,
which could be really bad on slow single core machines.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
All other test output goes to builddir too and moreover "make distcheck"
complains about writing to it's read-only srcdir.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Unarguably this change makes test output to be more messy, but when I
compare run time tells with clear numbers parallel is quicker. For me
the quickness is important factor. Running test suite always after a
change is preferrably quick, and if something is indicated to be broken
it is ok to spend time in drilling down what happen.
$ time ./tests/run.sh --parallel=5
[...]
real 1m48.037s
Same without parallelization.
$ time ./tests/run.sh
real 3m16.687s
The default is changed to be parallel, where job count is same as number
of CPUs.
[kzak@redhat.com: - propagate --parallel into function.sh
- don't use extra title for non-parallel execution
- disable by default]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
The command 'make check' is called from 'make distcheck' (which is
used to generate official util-linux tarballs).
It means that tests/ stuff has to be compatible with autotools and
differentiate between source and build directories.
* remove run-nonroot.sh (merged into run.sh
* remove commands.sh.in
* all tests and top level run.sh accept --builddir and --srcdir
command line options
* functions.sh modified to use $top_builddir/tests for output files
Signed-off-by: Karel Zak <kzak@redhat.com>
The previous "gplv2-only" was copy&past mistake. This re-licensing is
correct -- there is not any other contributor to this code.
Signed-off-by: Karel Zak <kzak@redhat.com>
The "." command will search $PATH before $PWD if the argument
specified contains no path qualifiers which can cause problems if
you happen to have something in $PATH named the same. The
attached patch changes all of the ". <foo>" in the tests subdir.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>