Commit Graph

25 Commits

Author SHA1 Message Date
Lucas De Marchi
2ad09ccf0f testsuite: errno is a positive number 2013-04-12 01:24:30 -03:00
Lucas De Marchi
489c04ddec testsuite: Exit with success on signal if test has expected_fail=true 2013-03-21 02:22:15 -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
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
Lucas De Marchi
b8e344a6d2 testsuite: add timeout for each test
Each test must run under 2 seconds. Ideally they should run in much less
than this; just give an arbitrary number so we don't wait forever in
case we reached an infinite loop somewhere.
2012-06-06 01:45:30 -03:00
Lucas De Marchi
ed8e93fd92 testsuite: create additional pipe to monitor child 2012-06-06 01:45:30 -03:00
Lucas De Marchi
0de690c96c testsuite: check if rootfs dir is dirty before running
Keep around a stamp-rootfs file that is generated together with the
rootfs. testsuite checks each test directory if its mtime is greater
than stamp's mtime, deciding if rootfs should be re-generated.
2012-06-05 00:54:47 -03:00
Lucas De Marchi
050db08c57 Add missing newlines
Checked with following semantic patch for the library:

// smpl
@a@
identifier virtual.func;
expression E1;
expression fmt;
position p1;
@@

func(E1, fmt@p1, ...)

@script:python b@
fmt << a.fmt;
p1 << a.p1;
@@

s = str(fmt)
if s.find("\\n") < 0:
	print p1[0].file + ":" + p1[0].line

// smpl

For tools, just remove E1
2012-02-18 03:56:21 -02:00
Lucas De Marchi
658e0471b3 testsuite: fix color of unexpected failure 2012-02-16 21:18:00 -02: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
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
d2c2b8b500 build-sys: autotoolify build of check libraries
Many thanks to Iván Briano (sachieru@gmail.com) for pointing out this
thread in libtool mailing list:
	http://www.mail-archive.com/libtool@gnu.org/msg09627.html

Passing '-rpath /nowhere' in LDFLAGS we are able to create shared libs
that are not installed.
2012-01-26 16:05:05 -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
9e3b9d2e8c testsuite: remind users to build tools 2012-01-26 16:05:05 -02:00
Lucas De Marchi
51b1d1ab28 testsuite: add colors to test output 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
45481ee28c testsuite: separate child from parent 2012-01-26 16:05:04 -02:00
Lucas De Marchi
6b88ef3e97 testsuite: allow to run tests outside of top_buildir
In order to locate where the shared libs to be preloaded are we need to
reference them using abs_top_buildir. Otherwise we are limited to
running tests from there.
2012-01-26 16:05:04 -02:00
Lucas De Marchi
395478cbbb testsuite: export environment with flags and LD_PRELOAD
A certain config can add flags and each flag may be associated with a
lib to LD_PRELOAD. It's now done for uname(2), which requires uname.so
in order to trap the calls.

Other trap will be added in later commits.
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
80f9e02382 testsuite: add skeleton 2012-01-26 16:05:04 -02:00