Commit Graph

103 Commits

Author SHA1 Message Date
Alex Gorrod
9768c2db0b WT-2554 Add initial C test framework. (#2655)
* WT-2554 Add initial C test framework.

With a few sample applications. Need to do further work to cleanup
the same applications and share as much code/style as possible.

* WT-2554 Fixup build errors.

* Fix compiler warning.

* Cleanup

* Ensure each test runs in a different directory.

* Update C test suite names and add copyright.

* Move test code into subdirectories.

* Replace test_util.i with a real utility library now that we have one.

Nothing needs to be an inline function.

Mostly cherry picked from 7c18420.

* Use WiredTiger getopt in C test suite for platform portability.

* Add a header comment to each test case.

* Add a C test suite entry auto generator

* Style, KNF

* Implement review feedback.

* Build test/utility library on Windows

* Add comment to script.  Fix a printf.
2016-05-23 13:13:54 -04:00
Keith Bostic
b59476e03d WT-2600: clean up test program includes (#2708)
Clean up test program #includes and add generic handling to memory allocation failures.

Now the test programs include <wt_internal.h>, the local includes
aren't necessary, and it makes lint sad.
2016-05-02 16:05:08 +10:00
Keith Bostic
e0633ed6ba WT-2508: test programs should remove test directories on the "clean" target
Pass over test programs, remove working directories in the clean target,
fix cut-and-paste (and other) problems where non-existent files were
removed.
2016-03-22 16:13:59 -04:00
Keith Bostic
525b9a6f30 WT-2422: multiple definitions of custom die function
Define the custom die function once per program.
2016-02-22 11:03:47 -05:00
Keith Bostic
fba53cac21 Consistently use __wt_yield() in all of the test programs. 2016-01-04 18:30:10 -05:00
Keith Bostic
344a714c3d Upgrade copyright notices from 2015 to 2016. 2016-01-01 16:37:39 -05:00
Michael Cahill
7063f8b6e8 SERVER-19340 Avoid type aliasing in the random number generator. 2015-07-27 12:07:31 +10:00
Michael Cahill
e6688915e8 WT-1987 Add a TEST_WRAPPER variable for running all tests with valgrind or similar. 2015-07-01 16:03:41 +10:00
Keith Bostic
bb986cf409 Avoid read/write races in the PRNG: switch to using an 8B value instead
of a two, 4B value array, declare the value volatile to avoid having the
compiler alter the read/write path.

Add a check if a PRNG component ever goes to zero and reset it.
2015-05-30 11:53:52 -04:00
David Hows
38a7aa843d More CR Cleanup 2015-05-13 09:49:20 +10:00
David Hows
21148870aa Change to __wt_exists 2015-05-12 13:41:33 +10:00
David Hows
ce5c286f22 Changes for CR 2015-05-11 15:12:43 +10:00
David Hows
d6d57add5e Fix failed tests 2015-05-11 12:45:09 +10:00
David Hows
12b1d56024 Change all testutils functions to return nothing 2015-05-11 12:41:50 +10:00
Keith Bostic
39a120eb03 test/checkpoint is using __wt_random_init/__wt_random, test programs are
using other __wt_XXX functions (for example, __wt_thread_id), several
include wt_internal.h.

Back out chunks of the last commit, instead, change the test programs
to use the WiredTiger library RNG functions, remove RNG functions from
test_util.i.
2015-05-08 13:58:49 -04:00
Keith Bostic
f54f7bf6d2 Pull out the RNG fucnctions into test_util.i.
Don't set the seed values based on the gettimeofday, use standard seeds.

Give every thread its own random number generation so we don't collide
on shared cache lines.
2015-05-08 13:33:47 -04:00
Keith Bostic
369b5d835b Ignoring return value of function 'testutil_clean_work_dir(char *)'
KNF
2015-05-08 09:55:55 -04:00
Alex Gorrod
10d5d1c03b Fix a compiler warning in test/thread.
../../../test/thread/rw.c:76: warning: 'tids' may be used uninitialized in this function
2015-05-08 07:21:59 +00:00
David Hows
1063fe5e57 CR Changes 2015-05-07 15:36:35 +10:00
David Hows
29477b0ac5 Add testutils to all tests 2015-05-05 14:51:23 +10:00
Keith Bostic
30b61e8abd Make the die() function look like all the other test programs,
support variadic arguments.
2015-04-14 08:41:52 -04:00
Keith Bostic
f776f9bf9f Fix the interrupt code to clean up the correct directory. 2015-04-14 08:34:06 -04:00
Keith Bostic
5ed5981b93 Fix the usage statement (options without arguments go first). 2015-04-14 08:13:07 -04:00
Alex Gorrod
4cf1871ca6 Make test/thread use WT_TEST not cwd, and add some more logging. 2015-04-14 06:30:41 +00:00
Alex Gorrod
3e5c7b036e Allow longer connection config strings in test/thread. 2015-04-14 03:24:18 +00:00
Alex Gorrod
01f4528400 Fix the offset used in test/thread. 2015-04-13 12:23:09 +00:00
Alex Gorrod
127cd8a275 Add a new statistic to track sweep evictions.
Add functionality to test/thread to vary the number of operations
on different tables. Hopfully it'll let us construct workloads where
tables are closed by sweep.
2015-04-13 07:45:25 +00:00
Keith Bostic
1f9098871a Copyright notices: add MongoDB, update to 2015. 2015-01-04 14:07:56 -05:00
Keith Bostic
f5b9170b79 /thread/t.c:49:12: error: redundant redeclaration of __wt_getopt
[-Werror=redundant-decls]
2014-10-22 16:13:46 -04:00
Keith Bostic
8731249f41 The type returned from pthread_self() is opaque, we can't cast it to a
(void *) and print it, use the underlying WiredTiger helper routine.
2014-10-22 15:55:56 -04:00
Keith Bostic
607b133aa5 gcc doesn't like externs inside functions (warning: nested extern
declaration ofXXX)
2014-10-10 09:02:55 -04:00
Keith Bostic
ee28ec9dda Move the utilities/util_getopt.c implementation of getopt(3) into the
WiredTiger library, and convert all of the utilities and test programs
to use it.
2014-10-10 08:52:55 -04:00
Keith Bostic
c2cb2d418a Simplify gcc.h, don't repeat the GCC atomic builtins, just use one version.
Break hardware.h up into gcc.h and lint.h (hardware.h is still there,
but it's mostly empty).
Remove need for gcc.h from various benchmarking/test programs.
2014-10-04 12:10:17 -04:00
Keith Bostic
4c63f1e53f Minor shuffling to turn on more clang warnings:
- a few more uninitialized variables
- make variables local to a single file static
- replace use of WT_UNUSED_RET with error checking of the call (the
	macro was using a GCC extension clang doesn't like)

With these changes, clang is mostly silent using the following options:

	-Weverything
	-Wno-cast-align
	-Wno-conversion
	-Wno-covered-switch-default
	-Wno-documentation-unknown-command
	-Wno-format-nonliteral
	-Wno-language-extension-token
	-Wno-missing-noreturn
	-Wno-packed
	-Wno-padded
	-Wno-switch-enum
	-Wno-zero-length-array

Also, minor KNF whitespace cleanups.
2014-09-01 15:03:26 -04:00
Keith Bostic
d0158f3105 Coverity report 1215467, open FILE handle could be leaked. 2014-05-23 08:27:20 -04:00
Keith Bostic
ce81a87f0c Test some more basic access method types and other variants in format
and thread check runs.
2014-05-22 09:29:43 -04:00
Keith Bostic
d1f76fdac4 Fix a memory leak, thanks valgrind! 2014-05-20 15:23:17 -04:00
Keith Bostic
176dccefc2 Add a -F option to thread, to create a separate file for every thread.
With this option, the command line combination "-FS -R 0 -W 10" will
trigger the checkpoint problem where closing a file fails because there
is an update for the file we can't write.

Reference #844, #957.
2014-05-20 10:47:54 -04:00
Michael Cahill
a1435ed3c1 Use the default cache size in test/thread: 5MB causes odd side effects that make the test slow, particularly with valgrind. 2014-05-09 11:28:28 +10:00
Keith Bostic
5b509b7220 Update copyright notices for 2014.
Move lang/java and lang/python into the public domain.
2014-01-07 10:30:12 -05:00
Michael Cahill
a81ef11988 Merge branch 'develop' into fine-grained-durability
Conflicts:
	dist/api_data.py
	dist/flags.py
	src/include/flags.h
	src/include/txn.h
	src/include/txn.i
	test/thread/t.c
2013-11-08 10:20:16 +11:00
Keith Bostic
9be66e1d26 Rework WT_UNUSED/WT_UNUSED_RET slightly: move GNUC macros out of misc.h
into their own include file "gcc.h", change the test programs to include
and use the definitions from that file.
2013-11-06 09:18:50 -05:00
Michael Cahill
56d82a4eb9 Merge branch 'develop' into fine-grained-durability
Conflicts:
	dist/stat_data.py
	src/include/wiredtiger.in
	src/support/stat.c
	test/salvage/salvage.c
	test/thread/t.c
2013-11-05 09:38:41 +11:00
Alex Gorrod
1e9c8b91d1 Fix compiler warnings with GCC 4.7.2 on Ubuntu. 2013-11-01 16:18:48 +11:00
Michael Cahill
9c70b206c0 Merge branch 'develop' into fine-grained-durability 2013-10-29 10:29:10 +11:00
Alex Gorrod
9e6fbc26a1 Merge branch 'develop' into java-auto-close 2013-10-25 09:34:43 +11:00
Michael Cahill
13ca7907d3 Merge branch 'develop' into fine-grained-durability
Conflicts:
	dist/s_define.list
2013-10-24 10:54:45 +11:00
Keith Bostic
a09b9b7ceb thread opens statistics cursors so we have to configure statistics in
the wiredtiger_open call.
2013-10-21 10:55:26 -04:00
Michael Cahill
6dfd4de7c8 When cleaning up after tests, remove the logs. 2013-08-29 22:37:46 +10:00
Alex Gorrod
3342b80ab8 Add a WT_SESSION handle to WT_EVENT_HANDLER callbacks.
Specifically added to handle_error, handle_message and handle_progress.
This change allows applications to match events to session handles.
2013-08-29 07:49:53 +00:00