]> granicus.if.org Git - check/log
check
10 years agono longer violate the const part of 'const char *' in send functions.
brarcher [Sat, 25 Jan 2014 18:18:14 +0000 (18:18 +0000)]
no longer violate the const part of 'const char *' in send functions.

FailMsg and LocMsg contain char* fields which are not const. Assigning
the passed const char* to a FailMsg or LocMsg violates the const.
To avoid this, a copy of the data is made using strdup. Yes, the
extra copy is functionally unnecessary, but to honor the const
it must be done.

The alternative is to make the char* fields in FailMsg and LocMsg
const. This will not work, however, as those fields are sometimes
assigned malloc'ed data in the code and free'd. You cannot pass
a const pointer to free without a warning.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1064 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoRemoving const identifier from List data structure
brarcher [Sat, 25 Jan 2014 18:18:12 +0000 (18:18 +0000)]
Removing const identifier from List data structure

The const identifier on the data field of List would imply that
nothing is ever done to modify or destroy the data. However, the
data can be accessed later and modified or freed, as was being done
in places. By removing the const identifiers, the implied safety
of the stored values (which is being violated anyway) is not
advertised in the API.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1063 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoSilence type conversion warnings in the (u)pack_int functions
brarcher [Sat, 25 Jan 2014 18:18:10 +0000 (18:18 +0000)]
Silence type conversion warnings in the (u)pack_int functions

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1062 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agochange expected exit values of tests to consistently be signed chars
brarcher [Sat, 25 Jan 2014 18:18:08 +0000 (18:18 +0000)]
change expected exit values of tests to consistently be signed chars

when a forked process finishes, waitpid() will return the status
as an int. Several macros determine what the status means.
WEXITSTATUS() is defined as returning the low-order 8 bits of the status
argument that the child process passed to _exit() or exit(), or the
value the child process returned from main(). It makes sense for the
value to be stored as either a signed or unsigned char. As the
decision is arbitrary (e.g. it only matters internally to check),
signed is used to keep consistent with the _tcase_add_test function.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1061 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoChanging duration returned from DIFF_IN_USEC to unsigned long
brarcher [Sat, 25 Jan 2014 18:18:05 +0000 (18:18 +0000)]
Changing duration returned from DIFF_IN_USEC to unsigned long

In the case that the diff returned from the start and end of the test
overflowed an unsigned int, making the container for the result
an unsigned long. (This is the type returned from the macro anyway).

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1060 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoremove unnecessary patches for Windows
brarcher [Wed, 22 Jan 2014 03:08:52 +0000 (03:08 +0000)]
remove unnecessary patches for Windows

A superset of these patches is incorporated into Check proper.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1059 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoweb: update release side-bar for 0.9.12
brarcher [Tue, 21 Jan 2014 04:05:47 +0000 (04:05 +0000)]
web: update release side-bar for 0.9.12

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1058 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoweb: mention that MSVC is supported by Check
brarcher [Tue, 21 Jan 2014 04:05:44 +0000 (04:05 +0000)]
web: mention that MSVC is supported by Check

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1057 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years ago* Update for release
brarcher [Tue, 21 Jan 2014 03:11:24 +0000 (03:11 +0000)]
* Update for release

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1055 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoweb: add new user of check
brarcher [Thu, 16 Jan 2014 23:08:03 +0000 (23:08 +0000)]
web: add new user of check

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1054 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agodoc: fix logic typo in fail_* API description
brarcher [Sun, 12 Jan 2014 20:19:41 +0000 (20:19 +0000)]
doc: fix logic typo in fail_* API description

Patch provided by Bill Kolokithas

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1053 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheckmk: list new supported directives
brarcher [Sun, 12 Jan 2014 20:19:37 +0000 (20:19 +0000)]
checkmk: list new supported directives

Patch provided by Bill Kolokithas

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1052 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheckmk: replace usage of deprecated check calls
brarcher [Sun, 12 Jan 2014 20:19:34 +0000 (20:19 +0000)]
checkmk: replace usage of deprecated check calls

Patch provided by Bill Kolokithas

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1051 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck_check_pack: use NULL as 'invalid string' instead of a literal
brarcher [Thu, 9 Jan 2014 03:51:55 +0000 (03:51 +0000)]
check_check_pack: use NULL as 'invalid string' instead of a literal

Just in case something does go wrong, the string literal could
end up being free'd. To prevent this, use NULL as the "this should
not happen" example instead.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1050 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck_check_fixture: free TestResult array when finished
brarcher [Thu, 9 Jan 2014 03:51:53 +0000 (03:51 +0000)]
check_check_fixture: free TestResult array when finished

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1049 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck_check_pack: free result_file at end of test
brarcher [Thu, 9 Jan 2014 03:51:50 +0000 (03:51 +0000)]
check_check_pack: free result_file at end of test

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1048 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoautotools/cmake: add cmake files to distribution
brarcher [Tue, 7 Jan 2014 03:24:48 +0000 (03:24 +0000)]
autotools/cmake: add cmake files to distribution

Otherwise, the cmake files will not get distributed with
the next check release.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1047 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_vars: add extra spaces around !=
brarcher [Tue, 7 Jan 2014 03:24:44 +0000 (03:24 +0000)]
test_vars: add extra spaces around !=

sh is picky about space, and without it the last part
of the condition always evaluates to true.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1046 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_vars: also check @IS_MSVC@ content
brarcher [Mon, 6 Jan 2014 13:25:14 +0000 (13:25 +0000)]
test_vars: also check @IS_MSVC@ content

On autotools if @IS_MSVC@ is not defined, it is left as a string
literal, instead of being nothing. Because of that, the content
is now also checked. For CMake and MSVC, @IS_MSVC@ will be '1'.
Otherwise, it can be anything else.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1045 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoweb: mention "Windows" on all Windows options
brarcher [Mon, 6 Jan 2014 04:41:54 +0000 (04:41 +0000)]
web: mention "Windows" on all Windows options

All the other options mention their OS, Windows options
should to.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1044 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoNEWS: Add information on Check with MSVC
brarcher [Mon, 6 Jan 2014 04:41:53 +0000 (04:41 +0000)]
NEWS: Add information on Check with MSVC

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1043 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoNEWS: Add clarification to running check_check in Windows
brarcher [Mon, 6 Jan 2014 04:41:51 +0000 (04:41 +0000)]
NEWS: Add clarification to running check_check in Windows

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1042 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck for both / and \ when logging XML
brarcher [Mon, 6 Jan 2014 04:41:48 +0000 (04:41 +0000)]
check for both / and \ when logging XML

Windows uses \ for directory delimitors, so detect that as well

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1041 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoOnly create datetime string if localtime_r succeeded
brarcher [Mon, 6 Jan 2014 04:41:46 +0000 (04:41 +0000)]
Only create datetime string if localtime_r succeeded

On MSVC localtime_r (which redirects to localtime in libcompat)
can fail. The reason is not yet known. Instead of printing
garbage in this case, simply do not print the date time.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1040 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agolibcompat: fix typo in comment
brarcher [Mon, 6 Jan 2014 04:41:44 +0000 (04:41 +0000)]
libcompat: fix typo in comment

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1039 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agolibcompat: remove alternatives for localtime_r
brarcher [Mon, 6 Jan 2014 04:41:41 +0000 (04:41 +0000)]
libcompat: remove alternatives for localtime_r

returning to the previous localtime_r implementation that uses
localtime. The _localtime64_s implementation had issues, in that
it wanted to write to the "now" variable. (Should have been
passed "result" instead). Further, on MSVC (for which this replacement
is being considered) localtime redirects to _localtime64_s anyway.

For how Check is using localtime_r, just using localtime is
sufficient.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1038 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_vars: add correct slash if on Unix or MSVC
brarcher [Mon, 6 Jan 2014 04:41:39 +0000 (04:41 +0000)]
test_vars: add correct slash if on Unix or MSVC

The IS_MSVC variable is only set from CMake, and only if
the platform is MSVC. If it is not set, the Unix slash will
be used.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1037 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_vars: deterine final value for SRCDIR in test_vars
brarcher [Mon, 6 Jan 2014 04:41:36 +0000 (04:41 +0000)]
test_vars: deterine final value for SRCDIR in test_vars

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1036 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: configure test_vars in the tests' CMakeLists.txt
brarcher [Mon, 6 Jan 2014 04:41:34 +0000 (04:41 +0000)]
cmake: configure test_vars in the tests' CMakeLists.txt

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1035 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoweb: add help for compiling Check with MSVC
brarcher [Mon, 6 Jan 2014 04:41:32 +0000 (04:41 +0000)]
web: add help for compiling Check with MSVC

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1034 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoweb: add help for compiling check using Visual Studios
brarcher [Mon, 6 Jan 2014 04:41:30 +0000 (04:41 +0000)]
web: add help for compiling check using Visual Studios

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1033 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoNEWS: update with info on new Check unit tests
brarcher [Mon, 6 Jan 2014 04:41:28 +0000 (04:41 +0000)]
NEWS: update with info on new Check unit tests

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1032 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_output.sh: fix typo in variable name
brarcher [Sat, 4 Jan 2014 19:39:44 +0000 (19:39 +0000)]
test_output.sh: fix typo in variable name

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1031 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoonly test test_invalid_set_fork_status if not mem leak checking
brarcher [Sat, 4 Jan 2014 19:26:38 +0000 (19:26 +0000)]
only test test_invalid_set_fork_status if not mem leak checking

This test leaks memory, as the allocated suite, test case, and
suite runner remain after the call to srunner_run_all() calls
exit(2) due to the error.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1030 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck_run.c: remove unreachable code
brarcher [Sat, 4 Jan 2014 19:26:36 +0000 (19:26 +0000)]
check_run.c: remove unreachable code

This code cannot be reached, as tr->msg is never not NULL in
this scope.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1029 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck_check_pack: add tests for using pack(), upack() improperly
brarcher [Sat, 4 Jan 2014 18:34:10 +0000 (18:34 +0000)]
check_check_pack: add tests for using pack(), upack() improperly

Sure, check does not use these improperly, but if we did,
just making sure they respond as expected.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1028 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_output.sh: add tests for srunner_print()
brarcher [Sat, 4 Jan 2014 18:34:08 +0000 (18:34 +0000)]
test_output.sh: add tests for srunner_print()

There were no tests for srunner_print(). These tests, when run
with the STDOUT_DUMP output type, will output the normal
output to stdout, then call
   srunner_print()
on each output type, dumping that to stdout.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1027 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_output.sh: spacing
brarcher [Sat, 4 Jan 2014 18:34:06 +0000 (18:34 +0000)]
test_output.sh: spacing

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1026 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_output.sh: separate progress and result from expected output
brarcher [Sat, 4 Jan 2014 18:34:05 +0000 (18:34 +0000)]
test_output.sh: separate progress and result from expected output

This separation will make testing the output of srunner_print()
easier later on.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1025 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoex_output.c: add new output mode STDOUT_DUMP
brarcher [Sat, 4 Jan 2014 18:34:03 +0000 (18:34 +0000)]
ex_output.c: add new output mode STDOUT_DUMP

This mode will print the normal suite progress and result to
stdout, but then dump every mode using
  srunner_print()

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1024 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck_log.c: remove unnecessary checks for CK_ENV
brarcher [Sat, 4 Jan 2014 18:34:01 +0000 (18:34 +0000)]
check_log.c: remove unnecessary checks for CK_ENV

this code is unnecessary, as srunner_register_lfun will
determine the real print mode before stdout_lfun gets called.
That is, CK_ENV will never be passed.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1023 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_output.sh: spacing
brarcher [Sat, 4 Jan 2014 18:33:59 +0000 (18:33 +0000)]
test_output.sh: spacing

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1022 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoAdd tests for CK_VERBOSITY env var
brarcher [Sat, 4 Jan 2014 18:33:58 +0000 (18:33 +0000)]
Add tests for CK_VERBOSITY env var

There were previously no tests that checked this.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1021 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_output.sh: do not include leading 'x' in expected output
brarcher [Sat, 4 Jan 2014 18:33:56 +0000 (18:33 +0000)]
test_output.sh: do not include leading 'x' in expected output

Mostly because it can be confusing.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1020 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_output.sh: rename variables to make sense
brarcher [Sat, 4 Jan 2014 18:33:55 +0000 (18:33 +0000)]
test_output.sh: rename variables to make sense

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1019 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoadd test for check_list_advance(NULL)
brarcher [Sat, 4 Jan 2014 18:33:53 +0000 (18:33 +0000)]
add test for check_list_advance(NULL)

There had been no test yet for this case.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1018 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoAdd test for setting invalid for status
brarcher [Sat, 4 Jan 2014 18:33:51 +0000 (18:33 +0000)]
Add test for setting invalid for status

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1017 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoAdd new test case for Check error printouts
brarcher [Sat, 4 Jan 2014 18:33:49 +0000 (18:33 +0000)]
Add new test case for Check error printouts

When check hits an eprintf() call, this is a "Check error printout".
This test case, only available when fork() is available, will
test the instances when check should hit an eprintf() and exit.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1016 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agodo not compile in msg and fork tests suites if fork() disabled
brarcher [Sat, 4 Jan 2014 18:33:46 +0000 (18:33 +0000)]
do not compile in msg and fork tests suites if fork() disabled

The tests were already disabled, but the TCase was still there,
but empty.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1015 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoAdd /* HAVE_FORK */ comment
brarcher [Sat, 4 Jan 2014 18:33:45 +0000 (18:33 +0000)]
Add /* HAVE_FORK */ comment

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1014 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck_run.c: also check HAVE_FORK==0 for fork disabled
brarcher [Sat, 4 Jan 2014 18:33:43 +0000 (18:33 +0000)]
check_run.c: also check HAVE_FORK==0 for fork disabled

Using CMake, !defined(HAVE_FORK) is not sufficient to determine
if fork is unavailable, has HAVE_FORK=0 is possible.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1013 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck.c: remove tr_reset()
brarcher [Sat, 4 Jan 2014 18:33:41 +0000 (18:33 +0000)]
check.c: remove tr_reset()

This function was never called anywhere

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1012 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck.c: remove debug
brarcher [Sat, 4 Jan 2014 18:33:39 +0000 (18:33 +0000)]
check.c: remove debug

removing some debug printing that was left in.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1011 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck_check_sub: add tests for suite_tcase(NULL,NULL)
brarcher [Sat, 4 Jan 2014 18:33:37 +0000 (18:33 +0000)]
check_check_sub: add tests for suite_tcase(NULL,NULL)

Previously a test that exercise this did not exist

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1010 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck.h: export suite_tcase() function
brarcher [Sat, 4 Jan 2014 18:33:35 +0000 (18:33 +0000)]
check.h: export suite_tcase() function

Because it did not have CK_EXPORT in front of it, the symbol
was not being exported. It looks like this function should
be callable, but it could not before.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1009 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: install check.h from the src directory
brarcher [Thu, 2 Jan 2014 13:19:28 +0000 (13:19 +0000)]
cmake: install check.h from the src directory

cmake was looking for check.h in the root directory, not under src.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1008 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: only run shell unit tests if sh interpreter is available
brarcher [Thu, 2 Jan 2014 13:19:26 +0000 (13:19 +0000)]
cmake: only run shell unit tests if sh interpreter is available

Namely, on the MSVC IDE, there is none.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1007 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoNEWS: mention status of MSVC: check_check passes
brarcher [Thu, 2 Jan 2014 02:43:24 +0000 (02:43 +0000)]
NEWS: mention status of MSVC: check_check passes

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1006 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: remove HAVE_* for snprintf in config.h.in
brarcher [Thu, 2 Jan 2014 02:43:22 +0000 (02:43 +0000)]
cmake: remove HAVE_* for snprintf in config.h.in

Having these caused MSVC to not compile, not having them
makes Linux fail prior to adding these definitions
in CMakeLists.txt. As they now cause problems for MSVC, but
the CMakeLists.txt definitions allow Linux to compile, there
should not be any issue.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1005 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: move snprintf definitions to make cmake file
brarcher [Thu, 2 Jan 2014 02:43:19 +0000 (02:43 +0000)]
cmake: move snprintf definitions to make cmake file

Keeping them in lib/CMakeLists.txt made them only visible
in libcompat. Moving them to the main CMakeLists.txt file
makes them visible to everything.

In addition, also setting the HAVE_* definitions if snprintf
is available.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1004 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: do not check HAVE__SNPRINTF
brarcher [Thu, 2 Jan 2014 02:43:17 +0000 (02:43 +0000)]
cmake: do not check HAVE__SNPRINTF

This did not hurt anything, but was missed earlier

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1003 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: add printf entries to config.h.in
brarcher [Thu, 2 Jan 2014 02:43:15 +0000 (02:43 +0000)]
cmake: add printf entries to config.h.in

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1002 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: remove many unneeded entries in config.h.in
brarcher [Thu, 2 Jan 2014 02:43:13 +0000 (02:43 +0000)]
cmake: remove many unneeded entries in config.h.in

These entries are probably not hurting anything, but
are unnecessary.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1001 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agolibcompat: remove ; from #defines
brarcher [Thu, 2 Jan 2014 02:43:11 +0000 (02:43 +0000)]
libcompat: remove ; from #defines

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1000 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoCheck for MEMORY_LEAKING_TESTS_ENABLED consistently
brarcher [Thu, 2 Jan 2014 02:43:09 +0000 (02:43 +0000)]
Check for MEMORY_LEAKING_TESTS_ENABLED consistently

The line number table did not have the related test
compiled out when it should have.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@999 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoCheck for __GNUC__ consistently
brarcher [Thu, 2 Jan 2014 02:43:07 +0000 (02:43 +0000)]
Check for __GNUC__ consistently

Some tests will only be executed if compiled on gcc. However,
some of the tables did not have the related entries
compiled out when compiled on MSVC. This lead to crashes during
tests. Removing the entries correctly prevents this.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@998 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoAlways check HAVE_FORK==1 if defined
brarcher [Thu, 2 Jan 2014 02:43:05 +0000 (02:43 +0000)]
Always check HAVE_FORK==1 if defined

For autotools this is not an issue, as HAVE_FORK is only
defined if fork is available, and thus HAVE_FORK==1.

Cmake, though, will define it either way, so it is possible
for HAVE_FORK==0. Most of these were caught earlier, but
a few were missed.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@997 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agolibcompat: put snprintf defines in libcompat.h
brarcher [Thu, 2 Jan 2014 02:43:02 +0000 (02:43 +0000)]
libcompat: put snprintf defines in libcompat.h

On MSVC, the cmake definitions do not seem to work as expected.
Putting the snprintf and vsnprintf definitions in libcompat.h.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@996 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agolibcompat: do not use _snprintf even if available
brarcher [Thu, 2 Jan 2014 02:43:00 +0000 (02:43 +0000)]
libcompat: do not use _snprintf even if available

After going back and forth on this one, it seems simpler to
use libcompat's snprintf, even if _snprintf is available.

There were issues on MSVC using _snprintf.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@995 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: add definitions for remaining printf functions
brarcher [Thu, 2 Jan 2014 02:42:57 +0000 (02:42 +0000)]
cmake: add definitions for remaining printf functions

Just in case they are needed for snprintf.c

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@994 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: add checks for remaining printf functions
brarcher [Thu, 2 Jan 2014 02:42:55 +0000 (02:42 +0000)]
cmake: add checks for remaining printf functions

snprintf.c expects several HAVE_* definitions, and by only checking
snprintf, most are unavailable which cause linking problems
with MSVC

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@993 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: enable unit test test_check_nofork.sh
brarcher [Thu, 2 Jan 2014 02:42:50 +0000 (02:42 +0000)]
cmake: enable unit test test_check_nofork.sh

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@992 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: extract check version from configure.ac
brarcher [Thu, 2 Jan 2014 02:42:47 +0000 (02:42 +0000)]
cmake: extract check version from configure.ac

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@991 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: remove unnecessary check for strerror()
brarcher [Thu, 2 Jan 2014 02:42:45 +0000 (02:42 +0000)]
cmake: remove unnecessary check for strerror()

There is no replacement for strerror currently. If this check
failed, nothing would be done anyway.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@990 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocheck_check_sub: sleep during test_eternal
brarcher [Thu, 2 Jan 2014 02:42:43 +0000 (02:42 +0000)]
check_check_sub: sleep during test_eternal

For some reason on Linux (maybe other systems) if
check_check is canceled (e.g. Ctrl+C) when the test_eternal
is running, check_check will still run in the background
on this test. Because the test is in a tight loop,
it eats lots of CPU. Replacing the busy loop with the sleep
does not fix the problem, but at least when it happens
it will not take lots of CPU.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@989 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agolibcompat: remove replacement for sleep()
brarcher [Thu, 2 Jan 2014 02:42:40 +0000 (02:42 +0000)]
libcompat: remove replacement for sleep()

Before working on MSVC support, the replacement sleep() call
only called assert(). Instead, it was assumed that the related
code would not be called, as the only platform that did not
provide a sleep() call also did not provide fork() (e.g. Windows),
so the related code never got executed.

As we still do not provide a fork(), the sleep() replacement is
unnecessary as it is never called. If, in the future, Check
provides a fork() replacement, then a sleep() replacement will
make sense.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@988 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agolibcompat: remove unsetenv replacement
brarcher [Thu, 2 Jan 2014 02:42:37 +0000 (02:42 +0000)]
libcompat: remove unsetenv replacement

no system to date has been found that provides setenv
but not unsetenv. If setenv is unavailable, all related
tests are disabled at compile time. This stub replacement
does not serve any purpose. If in the future a system
with unsetenv is found that does provide setenv, then
the unit tests will need to disable all tests that
require unsetenv.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@987 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agolibcompat: remove putenv replacement
brarcher [Thu, 2 Jan 2014 02:42:33 +0000 (02:42 +0000)]
libcompat: remove putenv replacement

the putenv replacement did nothing except call abort().
There is no platform (yet) which did not have putenv()
but did have fork(). For this reason, the assert()
has yet to be hit, meaning that the stub itself is
pointless.

If in the future a platform is found to have fork() but
not putenv(), then the related tests need to be disabled
at compile time using something like
  #if defined(HAVE_DECL_PUTENV)
along with a related AC_CHECK_DECLS check.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@986 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agocmake: remove unnecessary check for getenv()
brarcher [Thu, 2 Jan 2014 02:42:31 +0000 (02:42 +0000)]
cmake: remove unnecessary check for getenv()

autotools does not currently check for getenv(), so there
is nothing to do if it is actually missing.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@985 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agolibcompat: do not offer to replace setenv
brarcher [Thu, 2 Jan 2014 02:42:29 +0000 (02:42 +0000)]
libcompat: do not offer to replace setenv

if setenv is missing on the system, the only thing that is
affected are unit tests. Check itself does not need setenv.
In this case, the affected unit tests are not compiled in.

This change removed the stub setenv replacement which was
never called, even when a system did not provide it.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@984 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoreplace how setenv availability is detected
brarcher [Thu, 2 Jan 2014 02:42:26 +0000 (02:42 +0000)]
replace how setenv availability is detected

The generated config.h file defines HAVE_DECL_SETENV, which
was checked at compile time in libcompat to create
HAVE_WORKING_SETENV. There is no reason to have the latter, when
the former can be used directly.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@983 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agotest_xml_output: do not use -n with echo
brarcher [Tue, 31 Dec 2013 20:39:33 +0000 (20:39 +0000)]
test_xml_output: do not use -n with echo

On some systems (e.g. OSX) a script will use the built-in version
of echo, which does not support arguments. Instead of getting no
newline, instead there is an extra "-n" in the output.

Without the -n, everything works as expected.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@982 64e312b2-a51f-0410-8e61-82d0ca0eb02a

10 years agoautotools: include pthread.h when checking for clockid_t/timer_t
brarcher [Tue, 31 Dec 2013 20:39:31 +0000 (20:39 +0000)]
autotools: include pthread.h when checking for clockid_t/timer_t

Must include pthread.h to check for clockid_t and timer_t. This is
because MinGW and MinGW-w64 both put the time related definitions
in pthread headers and not in sys/types.h. Without optionally
including pthread.h, the check for these types may mistakenly fail.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@981 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agoconsolidate all output tests into ex_output.c
brarcher [Fri, 27 Dec 2013 18:18:17 +0000 (18:18 +0000)]
consolidate all output tests into ex_output.c

This way, it will be simpler to add more outputs. Simply extend
this file. Further, if any bugs are found and needed to be
regression tested, they are added to only one place.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@980 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agoautotools: do not make ex_*_output tests
brarcher [Fri, 27 Dec 2013 18:18:14 +0000 (18:18 +0000)]
autotools: do not make ex_*_output tests

All the output tests are being consolidated into ex_output.c

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@979 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agocmake: do not make the ex_*_output tests
brarcher [Fri, 27 Dec 2013 18:18:13 +0000 (18:18 +0000)]
cmake: do not make the ex_*_output tests

They are being removed, to be consolidated into ex_output.c

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@978 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agocmake: always set a value for ENABLE_SUBUNIT
brarcher [Wed, 25 Dec 2013 05:09:39 +0000 (05:09 +0000)]
cmake: always set a value for ENABLE_SUBUNIT

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@977 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agocmake: remove fake subunit check
brarcher [Wed, 25 Dec 2013 05:09:37 +0000 (05:09 +0000)]
cmake: remove fake subunit check

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@976 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agocmake: fix subunit lib check
brarcher [Wed, 25 Dec 2013 04:51:12 +0000 (04:51 +0000)]
cmake: fix subunit lib check

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@975 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agocmake: create a check_stdint.h file
brarcher [Wed, 25 Dec 2013 04:39:11 +0000 (04:39 +0000)]
cmake: create a check_stdint.h file

Sinple hack replacement for the autotools AX_CREATE_STDINT_H
command. There may be a better way to do this that actually
checks if stdint.h is available, and what to do if it is not.
However, There are checks for the various int types already.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@974 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agoremove stray ` in file
brarcher [Wed, 25 Dec 2013 03:38:05 +0000 (03:38 +0000)]
remove stray ` in file

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@973 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agolibcompat: add CK_DLL_EXP to all functions
brarcher [Wed, 25 Dec 2013 03:05:12 +0000 (03:05 +0000)]
libcompat: add CK_DLL_EXP to all functions

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@972 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agoAdd CK_DLL_EXP for all functions in libcheck
brarcher [Wed, 25 Dec 2013 03:05:11 +0000 (03:05 +0000)]
Add CK_DLL_EXP for all functions in libcheck

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@971 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agocmake: Add definitions for snprintf if replacement is needed
brarcher [Wed, 25 Dec 2013 03:05:09 +0000 (03:05 +0000)]
cmake: Add definitions for snprintf if replacement is needed

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@970 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agocmake: remove unnecessary checks
brarcher [Wed, 25 Dec 2013 03:05:07 +0000 (03:05 +0000)]
cmake: remove unnecessary checks

These checks are checking for things that Check never uses.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@969 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agolibcompat: remove fileno() replacement
brarcher [Wed, 25 Dec 2013 03:05:06 +0000 (03:05 +0000)]
libcompat: remove fileno() replacement

fileno() is no longer necessary, as pipe IO is now
handled with FILE API.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@968 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agolibcompat: remove read() and write() checks
brarcher [Wed, 25 Dec 2013 03:05:04 +0000 (03:05 +0000)]
libcompat: remove read() and write() checks

read() and write() are now unnecessary, as all pipe IO is
done using FILE APIs.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@967 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agolibcompat: remove pipe() replacement
brarcher [Wed, 25 Dec 2013 03:05:02 +0000 (03:05 +0000)]
libcompat: remove pipe() replacement

The pipe() call was only used in unit tests. As the ppack calls
now use only FILE APIs, pipe is unnecessary.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@966 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agosnprintf: fix some compile time checks for MSVC
brarcher [Wed, 25 Dec 2013 03:05:00 +0000 (03:05 +0000)]
snprintf: fix some compile time checks for MSVC

MSVC with cmake results in a few compile time checks
in snprintf.c not being compilable. Changing the statements
such that MSVC can understand them.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@965 64e312b2-a51f-0410-8e61-82d0ca0eb02a

11 years agouse only FILE* API for file reading/writing
brarcher [Wed, 25 Dec 2013 03:04:59 +0000 (03:04 +0000)]
use only FILE* API for file reading/writing

MSVC does not like switching between read()/write() API and
FILE* API using fileno(). The fileno() call seems to return something
that does not work with write(). Keeping the API used
consistent removes this problem.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@964 64e312b2-a51f-0410-8e61-82d0ca0eb02a