Alex Rønne Petersen 1ef4b48014 Mark an unused variable as such in eglib/test/file.c. 11 yıl önce
..
.gitignore 1af583b6d1 Ignore a few more files. 15 yıl önce
Makefile.am 079c2e126f [eglib] Remove test-glib code, we don't have to maintain compatibility with glib any more. Fixes #19638. 11 yıl önce
README 24f7344136 2006-08-19 Aaron Bockover <[email protected]> 19 yıl önce
UTF-16BE.txt ef5e26dc46 Fixed g_iconv() and g_convert(), improved unit test 14 yıl önce
UTF-16LE.txt ef5e26dc46 Fixed g_iconv() and g_convert(), improved unit test 14 yıl önce
UTF-32BE.txt ef5e26dc46 Fixed g_iconv() and g_convert(), improved unit test 14 yıl önce
UTF-32LE.txt ef5e26dc46 Fixed g_iconv() and g_convert(), improved unit test 14 yıl önce
UTF-8.txt ef5e26dc46 Fixed g_iconv() and g_convert(), improved unit test 14 yıl önce
array.c 6809d60afc 2006-10-18 Gonzalo Paniagua Javier <[email protected]> 19 yıl önce
dir.c 10f6ce36d0 2007-04-27 Jonathan Chambers <[email protected]> 18 yıl önce
driver.c 116c8f9958 Do not build the parser if no getopt is there 16 yıl önce
endian.c fb4751751c 2006-10-14 Miguel de Icaza <[email protected]> 19 yıl önce
fake.c c1228dfc99 2006-08-21 Aaron Bockover <[email protected]> 19 yıl önce
file.c 1ef4b48014 Mark an unused variable as such in eglib/test/file.c. 11 yıl önce
hashtable.c 5189834841 Fix test compilation with older glibs. 15 yıl önce
list.c e584f7c3ae 18 yıl önce
markup.c 104b552fa8 No more warnings building eglib. 15 yıl önce
memory.c 87ca655071 2008-08-04 Bill Holmes <[email protected]> 17 yıl önce
module.c 10f6ce36d0 2007-04-27 Jonathan Chambers <[email protected]> 18 yıl önce
path.c cfa274f02d Add tests and correctly handle using '/' in windows paths. 13 yıl önce
pattern.c 10f6ce36d0 2007-04-27 Jonathan Chambers <[email protected]> 18 yıl önce
ptrarray.c 50150fec0b [eglib] Implement g_ptr_array_sort_with_data() 14 yıl önce
queue.c c251a8d7d1 2009-09-26 Gonzalo Paniagua Javier <[email protected]> 16 yıl önce
shell.c 53be988d65 [eglib] Add more tests for the g_shell_parse 15 yıl önce
sizes.c a2f850e178 Fixed missing pointer conversion tests in sizes.c 12 yıl önce
slist.c e584f7c3ae 18 yıl önce
spawn.c 10f6ce36d0 2007-04-27 Jonathan Chambers <[email protected]> 18 yıl önce
string-util.c b8eb131d3f Fix g_strsplit() when delimiter at end-of-string and at max_count. 13 yıl önce
string.c 10f6ce36d0 2007-04-27 Jonathan Chambers <[email protected]> 18 yıl önce
test-both bc434b09d7 2006-08-19 Aaron Bockover <[email protected]> 19 yıl önce
test.c b80b1cf567 2010-08-02 Zoltan Varga <[email protected]> 15 yıl önce
test.h 1d5c86adff Fix some compiler warning that SUSE takes seriously. 15 yıl önce
tests.h 385fa668d4 Make this build on systems with no filesystem or process APIs 16 yıl önce
timer.c 10f6ce36d0 2007-04-27 Jonathan Chambers <[email protected]> 18 yıl önce
unicode.c c1af5e0596 2008-11-04 Atsushi Enomoto <[email protected]> 17 yıl önce
utf8.c 9c1df247ba Fix the eglib test suite. 13 yıl önce
whats-implemented 4dd27b6570 Do not require setting MONO_CHECKOUT if run from <checkout>/eglib/test; ignore functions that are implemented privately by mono but have the g_* name pattern, causing false positives 18 yıl önce

README

EGlib Unit Testing
===============================================================================

1. Writing new tests
2. Using the test driver

===============================================================================
1. Writing new tests
===============================================================================

Tests are easy to write, but must be grouped in to logical cases. For instance,
the GPtrArray group has a number of tests that cover the entire GPtrArray
implementation.

These logical case groups should be in a single C file, and must have
three elements:

#include
#include "test.h"

...

...

static Test groupname_tests [] = {
{"groupname_test1", groupname_test1},
{"groupname_test1", groupname_test2},
{NULL, NULL}
};

DEFINE_TEST_GROUP_INIT(groupname_tests_init, groupname_tests)

A test implementation should look like:

RESULT groupname_test1()
{


if(test_failed) {
return FAILED("reason: %s", "this works like printf");
}

return OK; /* just NULL, but OK is cute */
}

Once a test group is written, it needs to be added to the groups table
in tests.h:

DEFINE_TEST_GROUP_INIT_H(groupname_tests_init) // same as in impl

static Group test_groups [] = {
...
{"groupname", groupname_tests_init}
...
};

===============================================================================
2. Using the test driver
===============================================================================

When tests are written, they are rebuilt with make. Two programs will be
built:

test-eglib: the test driver and tests linked against eglib
test-glib: the test driver and tests linked against system glib-2.0

Each driver program works exactly the same. Running test-eglib will run
the tests against eglib, and test-glib against glib-2.0.

The test driver supports a few options to allow for performance measuring:

--help show all options and available test groups
--time time the overall run and report it, even if --quiet is set
--quiet do not print test results, useful for timing
--iterations N run all or specified test groups N times

Run "test-eglib --help" for more details.

Example: run the ptrarray test group 100000 times and only print the time
it took to perform all iterations

./test-eglib -tqi 100000 ptrarray

Example: show single iteration of test output for two groups

./test-eglib ptrarray hashtable

Example: show test output of all available groups

./test-eglib

The 'test-both' script can be used to run both test-eglib and test-glib
with the same options back to back:

$ ./test-both -tqi 100000 ptrarray
EGlib Total Time: 1.1961s
GLib Total Time: 0.955957s

test-both also has a nice --speed-compare mode that shows comparison
information about EGlib vs GLib. It can run all tests or specific tests
with a configurable number of iterations. --speed-compare mode always runs
the drivers with -qtni

The syntax for --speed-compare is:

./test-both --speed-compare [ITERATIONS] [GROUPS...]

$ ./test-both --speed-compare Runs all tests with default iterations
$ ./test-both --speed-compare 500 Runs all tests with 500 iterations
$ ./test-both --speed-compare ptrarray Runs ptrarray test with default
iterations