Commit Graph

23 Commits

Author SHA1 Message Date
Michal Marek
88ac40840f testsuite: Check the list of loaded modules after a test
Add a ->modules_loaded member to struct test, which is a comma-separated
list of modules that should be present after the test finishes. Both
missing and excess modules cause an error.
2014-03-05 12:22:37 -03:00
Lucas De Marchi
d96ca9c429 Use C11's noreturn
Also define noreturn w/o <stdnoreturn.h> and move it to macro.h instead
of in the testsuite.

Based on similar commit on systemd by Shawn Landden
<shawn@churchofgit.com>.
2013-12-17 19:10:16 -02:00
John Spencer
bd4e7340bc testsuite: fix usage of reserved names
stdout and stderr are names reserved for the implementation
and musl uses them rightfully as macro - and the expansion
causes (of course) unexpected results.

rename the struct members stdout to out and stderr
to err, to be 1) compliant 2) cause compilation to
succeed.

fixes build with musl libc.
2013-08-29 01:22:20 -03:00
Lucas De Marchi
e6b0e49b4e Update copyright notices 2013-01-16 11:27:45 -02:00
Lucas De Marchi
3e451bfefb testsuite: allow to check generated files
This gives the test cases the ability to supply files that must be
checked after the test is run, rather than just checking stdout/stderr.

This is intended to be used with tools that generate files, like depmod.
It includes a poor's man implementation of a "check for differences in
files". Not really optimized, but it's simple enough and does what it
proposes to.
2012-10-04 01:04:52 -03:00
Lucas De Marchi
e8fd8fec23 Use #pragma once instead of #ifndef
Only the public header maintains #ifndef in the header, together with
pragma. The other ones contain only pragma.

As reported by Shawn Landden on systemd mailing list this is compatible
with all major compilers and gcc has this since version 3.3.
2012-07-18 10:31:50 -03:00
Lucas De Marchi
e1b1ab24ab testsuite: re-license under LGPL 2012-07-10 10:31:57 -03:00
Lucas De Marchi
34db3f2d3e testsuite: allow to export custom env vars 2012-06-06 01:45:30 -03:00
Dave Reisner
f31d49c8b3 testsuite: add .path member to test struct
This allows us to prepend an arbitrary item to the PATH environment
variable, meaning we can favor the binaries we just built, rather than
relying on those in the filesystem.
2012-02-16 16:52:38 -02:00
Lucas De Marchi
32d29b3523 Mark functions with attribute noreturn
Functions that always call exit() should be marked with attribute
noreturn. With glibc this is not necessary, but it fails to compile with
uClibc otherwise.
2012-02-08 20:32:31 -02:00
Lucas De Marchi
c5d81989bc testsuite: macronify test definitions 2012-02-07 10:46:46 -02:00
Lucas De Marchi
e9fa9de3c9 testsuite: macronify main function 2012-02-07 10:09:20 -02:00
Lucas De Marchi
23e354bfdf testsuite: add README 2012-02-06 16:50:54 -02:00
Dave Reisner
fa0046ba83 testsuite: allow for expected failure of tests
Adds a bool to the test struct called 'expected_fail' which can be set
to flip the logic used to determine success and failure. Messaging is
also changed to reflect an unexpected pass or expected fail. This can be
used to write tests which may represent functionality desirable for a
future release.
2012-01-31 14:08:57 -02:00
Lucas De Marchi
e701e381fa testsuite: add GPL license 2012-01-26 17:02:05 -02:00
Lucas De Marchi
f6ef5d6b5f testsuite: trap calls to delete_module() including simple test 2012-01-26 16:14:18 -02:00
Lucas De Marchi
53646fc56f testsuite: add trap to init_module() including simple test 2012-01-26 16:05:05 -02:00
Lucas De Marchi
95daea07f4 testsuite: add test for modinfo
These ext4 modules were sent by Jon Master so we can test the result of
modinfo with modules generated for different architectures.

They are now added to testsuite and their output tested automatically.
2012-01-26 16:05:05 -02:00
Lucas De Marchi
3dbb8dea5f testsuite: match outputs of test with a known correct one
Tests may put the correct output in a file and tell testsuite to check
if it matches the output from the test running.

Testsuite compares the outputs while running the test: it creates a pipe
between parent and child; parent reads both stdout and stderr from child
and compares with the correct output.
2012-01-26 16:05:05 -02:00
Lucas De Marchi
6afc9cd616 testsuite: add trap to fopen() including tests 2012-01-26 16:05:04 -02:00
Lucas De Marchi
ed2df4e984 testsuite: move oneshot to inside the test struct 2012-01-26 16:05:04 -02:00
Lucas De Marchi
68cc449376 testsuite: trap calls to uname 2012-01-26 16:05:04 -02:00
Lucas De Marchi
80f9e02382 testsuite: add skeleton 2012-01-26 16:05:04 -02:00