]> granicus.if.org Git - check/log
check
11 years agoIf clocks are not defined, set to (hopefully) invalid value
brarcher [Tue, 1 Oct 2013 22:21:08 +0000 (22:21 +0000)]
If clocks are not defined, set to (hopefully) invalid value

Likely, if clock_gettime() is implemented on a system, the first
valid clock will be set to '0'. If not all clock are defined,
by setting our fake definitions to '0', we may accidental use a
valid clock when we did not mean to. Setting the clocks to '-1'
in hopes to avoid this.

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

11 years agoDefine monotonic and realtime clock, even if librt is available
brarcher [Tue, 1 Oct 2013 22:21:06 +0000 (22:21 +0000)]
Define monotonic and realtime clock, even if librt is available

Cygwin has librt and implements clock_gettime(), but does not
define CLOCK_MONOTONIC.

Moving these definitions outside of the check for librt, as they
may be needed even if the system has librt.

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

11 years agoRemove warnings about combining initialization and declaration
brarcher [Tue, 1 Oct 2013 22:21:04 +0000 (22:21 +0000)]
Remove warnings about combining initialization and declaration

Clang warns that FILE* should be declared before it is assigned,
and to not mix declarations and code.

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

11 years agoRemove warning about undeclared function ck_strdup_printf
brarcher [Tue, 1 Oct 2013 22:21:02 +0000 (22:21 +0000)]
Remove warning about undeclared function ck_strdup_printf

check_msg.c was not including check_str.h to get the
prototype for ck_strdup_printf. Now fixed.

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

11 years agoinitialize both elements in timespec
brarcher [Tue, 1 Oct 2013 22:21:00 +0000 (22:21 +0000)]
initialize both elements in timespec

Initializing a timespect to {0} only initializes the first
field. Needed to assign {0,0} to get both fields.

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

11 years agoif tmpfile() fails, remember the filename and delete it later
brarcher [Sat, 28 Sep 2013 03:10:43 +0000 (03:10 +0000)]
if tmpfile() fails, remember the filename and delete it later

One feature of tmpfile() is to unlink the file, causing it to be
deleted after it is closed. Unlinking an open file fails in Windows.
To prevent the case where the temp directory just fills up with
files, the created file name is remembered, and deleted when
it is closed.

Certainly, if a unit test fails before it deletes the file,
the temp directory will still fill up. However, this is better
than not deleting the files.

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

11 years agoPrint an error if nothing is read from punpack()
brarcher [Sat, 28 Sep 2013 03:10:42 +0000 (03:10 +0000)]
Print an error if nothing is read from punpack()

There is some issue with MinGW-w64 builds run on wine, if multiple
unit test programs are run concurrently. Sometimes they will fail
to get something from punpack. It may be a failure to read the file,
or the file, or some other issue.

When this happens, later in receive_test_result the rmesg is free'd,
but only by freeing its elements first, which causes a segfault.

Instead of crashing, check should error out gracefully.

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

11 years agoIf tmpfile() fails, try to make a unique file with tempnam() and getpid()
brarcher [Sat, 28 Sep 2013 03:10:40 +0000 (03:10 +0000)]
If tmpfile() fails, try to make a unique file with tempnam() and getpid()

On systems where tmpfile() does not work, we try to fallback on
using tempnam() and fopen() to get a temporary unique file.

However, tempnam is not enough to get a unique name. Between
getting the name and opening the file, something else also
calling tempnam() could get the same name. It has been observed
on MinGW-w64 builds on Wine that this exact thing happens
if multiple instances of a unit tests are running concurrently.
To prevent two concurrent unit tests from getting the same file,
we append the pid to the file. The pid should be unique on the
system.

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

11 years agoUpdate NEWS with information on MinGW-w64/wine support
brarcher [Sat, 28 Sep 2013 03:10:38 +0000 (03:10 +0000)]
Update NEWS with information on MinGW-w64/wine support

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

11 years agotest_xml_output: removing stray ${3}
brarcher [Sat, 28 Sep 2013 00:34:02 +0000 (00:34 +0000)]
test_xml_output: removing stray ${3}

There is no third argument (or any argument) to this script.
Removing the unneeded ${3}

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

11 years agotest_log_output: Fixed typo in test
brarcher [Sat, 28 Sep 2013 00:34:01 +0000 (00:34 +0000)]
test_log_output: Fixed typo in test

There is no third argument, only the first argument.

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

11 years agoFix how tests remove \r characters
brarcher [Sat, 28 Sep 2013 00:33:59 +0000 (00:33 +0000)]
Fix how tests remove \r characters

   sed 's/\r//g'
worked for my Linux machine, but OSX expected
   sed 's/\\\\r//g'

Avoid using sed at all, and instead use
   tr -d "\r"
which works on both platforms.

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

11 years agoFix small text errors in test's help output.
brarcher [Sat, 28 Sep 2013 00:33:57 +0000 (00:33 +0000)]
Fix small text errors in test's help output.

Likely the CR* was true at one point, but was changed to CK_*

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

11 years agoDo not make decision based on fork status for which ctx to assign
brarcher [Sat, 28 Sep 2013 00:33:55 +0000 (00:33 +0000)]
Do not make decision based on fork status for which ctx to assign

This condition worked when the fork status was CK_FORK. However,
if the fork status was CK_NOFORK, it would fail. The values of
lastctx and failctx would be the same, however the wrong one would
be written if CK_NOFORK was being used.

There does not seem to be any reason why lastctx could not be used
all the time. No decision in messaging seems to be related to
the fork status.

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

11 years agocheck_check: do not run tests using setenv if unavailable
brarcher [Sat, 28 Sep 2013 00:33:53 +0000 (00:33 +0000)]
check_check: do not run tests using setenv if unavailable

If the system does not have setenv(), do not use it during
tests. The libcompat version calls assert(), failing the test.

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

11 years agotest_check_nofork: removing assumption that HAVE_FORK=0 implied Windows
brarcher [Fri, 27 Sep 2013 01:38:43 +0000 (01:38 +0000)]
test_check_nofork: removing assumption that HAVE_FORK=0 implied Windows

With the configuration option --disable-fork, *nix systems
can also be compiled without using fork. To fix the
line encoding, sed is used to remove \r before the check.

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

11 years agotest_output: removing assumption that HAVE_FORK=0 implied Windows
brarcher [Fri, 27 Sep 2013 01:38:41 +0000 (01:38 +0000)]
test_output: removing assumption that HAVE_FORK=0 implied Windows

With the configuration option --disable-fork, *nix systems
can also be compiled without using fork. To fix the
line encoding, sed is used to remove \r before the check.

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

11 years agotest_log_output: removing assumption that HAVE_FORK=0 implied Windows
brarcher [Fri, 27 Sep 2013 01:38:39 +0000 (01:38 +0000)]
test_log_output: removing assumption that HAVE_FORK=0 implied Windows

With the configuration option --disable-fork, *nix systems
can also be compiled without using fork. To fix the
line encoding, sed is used to remove \r before the check.

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

11 years agotest_xml_output: remove check for -1 in durations
brarcher [Fri, 27 Sep 2013 01:38:37 +0000 (01:38 +0000)]
test_xml_output: remove check for -1 in durations

This test is only valid on platforms that have a functional
clock_gettime() and do not have a good replacement in libcompat.
If there is no good replacement, then all durations will be 0,
even during failures. Instead of forcing the duration to be
negative during a failure artificially, we remove the requirement.

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

11 years agotest_xml_output: removing assumption that HAVE_FORK=0 implied Windows
brarcher [Fri, 27 Sep 2013 01:38:35 +0000 (01:38 +0000)]
test_xml_output: removing assumption that HAVE_FORK=0 implied Windows

With the configuration option --disable-fork, *nix systems
can also be compiled without using fork. To fix the
line encodings, sed is used to remove \r before the check.

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

11 years agoOnly use signals if fork is available
brarcher [Fri, 27 Sep 2013 01:38:33 +0000 (01:38 +0000)]
Only use signals if fork is available

The code at the top of this file for signals and fork is protected by
HAVE_FORK. The signals usage is not very useful without fork, so
now protecting the signal code with HAVE_FORK as well.

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

11 years agoallow disabling fork, to test for systems without fork
brarcher [Fri, 27 Sep 2013 01:38:31 +0000 (01:38 +0000)]
allow disabling fork, to test for systems without fork

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

11 years agodisable exit tests if fork is unavailable
brarcher [Thu, 26 Sep 2013 02:31:47 +0000 (02:31 +0000)]
disable exit tests if fork is unavailable

all of these tests expect that calling exit() during a test is OK.
Without fork, these tests just result in killing the unit test
program early.

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

11 years agodisable checked signal tests if fork is unavailable
brarcher [Thu, 26 Sep 2013 02:31:44 +0000 (02:31 +0000)]
disable checked signal tests if fork is unavailable

As mentioned in a previous commit, checked fixtures are disabled
if fork is unavailable, as they are unable to provide the guarantees
that they advertise without fork.

In addition, some line numbers are updated. This is because some tests
are looking through error messages, and the line number of the
messages is important.

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

11 years agoDisable checked fixtures if fork is unavailable
brarcher [Thu, 26 Sep 2013 02:31:42 +0000 (02:31 +0000)]
Disable checked fixtures if fork is unavailable

checked fixtures allow setup and teardown functions to be run in the
same process space as tests. If a fixture fails, the error is caught
and reported as a failure for the associated test.

If fork is not used, then the guarantee that checked fixtures try to
provide is not possible. Further, using checked fixtures without fork can
cause issues. For example, without fork if a checked teardown
calls ck_assert() which fails, this results in longjmp being called,
which results in the teardowns being called again. An infinate loop
results.

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

11 years agoChanging the value passed to malloc to be size_t instead of int
brarcher [Thu, 26 Sep 2013 02:31:39 +0000 (02:31 +0000)]
Changing the value passed to malloc to be size_t instead of int

We should not pass a negative number to malloc. Making size
of type size_t to emphasize this.

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

11 years agoThe number of elements in a list is now unsigned
brarcher [Mon, 23 Sep 2013 17:58:11 +0000 (17:58 +0000)]
The number of elements in a list is now unsigned

there can never be a negative number of elements in a list.
Changing the values to unsigned to enforce this.

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

11 years agoDisable warning from implicit cast of double to time_t or long
brarcher [Mon, 23 Sep 2013 17:58:10 +0000 (17:58 +0000)]
Disable warning from implicit cast of double to time_t or long

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

11 years agoAdd noreturn attribute to select functions and added -Wmissing-noreturn
brarcher [Mon, 23 Sep 2013 17:58:09 +0000 (17:58 +0000)]
Add noreturn attribute to select functions and added -Wmissing-noreturn

Added the gcc attribute noreturn to a few functions that could use it
(but only if the compiler is gcc 2.5 >=),  and added the warning to
point out when a function should use noreturn.

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

11 years agoAdding warning flags
brarcher [Mon, 23 Sep 2013 17:58:07 +0000 (17:58 +0000)]
Adding warning flags

These flags do not cause any warnings to be emitted currently.
Adding them now, in case a future change causes a warning.

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

11 years agoAdding a missing case in a switch statement
brarcher [Mon, 23 Sep 2013 17:58:06 +0000 (17:58 +0000)]
Adding a missing case in a switch statement

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

11 years agoThe mutex cleanup function is now declared as static
brarcher [Mon, 23 Sep 2013 17:58:02 +0000 (17:58 +0000)]
The mutex cleanup function is now declared as static

ppack_cleanup should not be called outside of check_pack.c,
as it is passed as a cleanup callback to pthread. Declaring it
as static.

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

11 years agoDetermine at runtime which clockid_t to use for clock_gettime
brarcher [Mon, 23 Sep 2013 15:17:56 +0000 (15:17 +0000)]
Determine at runtime which clockid_t to use for clock_gettime

The cygwin platform (perhaps others) does not support
CLOCK_MONOTONIC in clock_gettime. However, it does support
CLOCK_REALTIME. Instead of having every call to clock_gettime
check which clock to use, check once and cache the result.

The only two clock options which seemed useful are CLOCK_MONOTONIC
and CLOCK_REALTIME. If others are available in the future
(or another clock type seems a good alternative if these two are
missing on a system) it can be added later.

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

11 years agoUse clockid_t in prototype for clock_gettime
brarcher [Mon, 23 Sep 2013 15:17:54 +0000 (15:17 +0000)]
Use clockid_t in prototype for clock_gettime

The clockid_t type will be needed in a future commit. In preparation,
providing the type now in libcompat.h.

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

11 years agoDo not expect the duration for no-fork mode tests to be negative
brarcher [Mon, 23 Sep 2013 15:17:52 +0000 (15:17 +0000)]
Do not expect the duration for no-fork mode tests to be negative

For tests using fork, if the test fails exit() is called, which results
in the duration not being recorded for the test.

no-fork mode instead requires all tests to return, meaning their
duration is always recorded.

The test_xml_output.sh test expected that all failed tests have a negative
duration, which is not the case for no-fork mode. Removing
this expectation, and instead forcing all durations to be >=0 for
no-fork mode.

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

11 years agoinitialize timespec's to {0}
brarcher [Mon, 23 Sep 2013 15:17:50 +0000 (15:17 +0000)]
initialize timespec's to {0}

In case the clock_gettime call fails, the timespec values need to be
a sane value.

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

11 years agomodify test_xml_output.sh to compare output based on HAVE_FORK
brarcher [Mon, 23 Sep 2013 13:07:03 +0000 (13:07 +0000)]
modify test_xml_output.sh to compare output based on HAVE_FORK

When run in Windows, the output differs slightly from when it is run
under *NIX due to line endings. *NIX uses \n, whereas Windows
uses \r\n. To account for this, printf is used to generate the
Windows expected string.

Additionally, the test_exit test was removed, as it is not valid
if fork is unavailable.

Note that the test does not yet pass for MinGW due to a bug yet to be
identified. The last test failure to compare against currently has
a duration which is not -1.

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

11 years agomodify test_log_output.sh to compare output based on HAVE_FORK
brarcher [Mon, 23 Sep 2013 13:07:01 +0000 (13:07 +0000)]
modify test_log_output.sh to compare output based on HAVE_FORK

When run in Windows, the output differs slightly from when it is run
under *NIX due to line endings. *NIX uses \n, whereas Windows
uses \r\n. To account for this, printf is used to generate the
Windows expected string.

Additionally, the test_exit test was removed, as it is not valid
if fork is unavailable.

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

11 years agomodify test_check_nofork.sh to compare output based on HAVE_FORK
brarcher [Mon, 23 Sep 2013 13:06:58 +0000 (13:06 +0000)]
modify test_check_nofork.sh to compare output based on HAVE_FORK

When run in Windows, the output differs slightly from when it is run
under *NIX due to line endings. *NIX uses \n, whereas Windows
uses \r\n. To account for this, printf is used to generate the
Windows expected string.

One other change is not using stderr for the test. Wine has an issue
with the tmpfile() call, and will output:
   fixme:msvcrt:MSVCRT__sopen_s : pmode 0x0033 ignored
to stderr when tmpfile() is called. Besides, if the test actually
does segfault in the future (which is the reason for grabbing the stderr),
the result will not be to print out the test results.

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

11 years agomodify test_output.sh to compare output based on HAVE_FORK
brarcher [Sun, 22 Sep 2013 23:29:05 +0000 (23:29 +0000)]
modify test_output.sh to compare output based on HAVE_FORK

The output of ex_output changes based on HAVE_FORK, as a test is
skipped when fork is unavailable. However, simply adding another
string mentioning one less test is not enough to get this working
for Windows...

When run in Windows, the output differs slightly from when it is run
under *NIX due to line endings. *NIX uses \n, whereas Windows
uses \r\n. To account for this, printf is used to generate the
Windows expected string.

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

11 years agoDo not run test_exit if fork is unavailable
brarcher [Sun, 22 Sep 2013 23:29:03 +0000 (23:29 +0000)]
Do not run test_exit if fork is unavailable

if fork is unavailable, the test is not valid, as it makes the
unit test runner exit early.

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

11 years agoexport HAVE_FORK to testing shell scripts
brarcher [Sun, 22 Sep 2013 23:29:01 +0000 (23:29 +0000)]
export HAVE_FORK to testing shell scripts

The testing scripts will need to know if fork is available or not,
as different tests will run if it is.

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

11 years agoRemove explicit set of CK_NOFORK when fork is unavailable
brarcher [Sun, 22 Sep 2013 21:27:58 +0000 (21:27 +0000)]
Remove explicit set of CK_NOFORK when fork is unavailable

the default behavior is to now set the fork mode as CK_NOFORK
if fork is unavailable. The code being removed is redundant.

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

11 years agoAdd test for setting CK_FORK mode
brarcher [Sun, 22 Sep 2013 21:27:55 +0000 (21:27 +0000)]
Add test for setting CK_FORK mode

There was a test for setting CK_NOFORK, but not for CK_FORK.

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

11 years agoPost an error if a fork mode is set and fork is unavailable
brarcher [Sun, 22 Sep 2013 21:27:53 +0000 (21:27 +0000)]
Post an error if a fork mode is set and fork is unavailable

The default fork mode if fork is unavailable is CK_NOFORK.
Someone trying to set a fork mode without fork available will
only result in failures running tests. Posting an error up
front before tests are run makes more sense.

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

11 years agoSet default fork mode to CK_NOFORK if fork is unavailable
brarcher [Sun, 22 Sep 2013 21:27:50 +0000 (21:27 +0000)]
Set default fork mode to CK_NOFORK if fork is unavailable

The default fork mode is CK_FORK_GETENV, which checks the
environment, and failing that falls back on using fork.
If fork is unavailable, the default is now to set CK_NOFORK.

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

11 years agocheck_check: do setup regardless of availability of fork
brarcher [Sun, 22 Sep 2013 21:27:47 +0000 (21:27 +0000)]
check_check: do setup regardless of availability of fork

The tests originally protected by the HAVE_FORK check will
work if fork is unavailable. Further, setup() does work that
is required by the tests which follow.

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

11 years agoUpdate NEWS file with information on MinGW-w64 builds
brarcher [Sun, 22 Sep 2013 17:23:03 +0000 (17:23 +0000)]
Update NEWS file with information on MinGW-w64 builds

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

11 years agoIf fork unavailable, run tests with CK_NOFORK
brarcher [Sun, 22 Sep 2013 17:23:02 +0000 (17:23 +0000)]
If fork unavailable, run tests with CK_NOFORK

Although the tests which check the correctness of fork-based tests
are disabled if fork is unavailable, the remaining tests were
still run assuming fork was available.

If there is no fork, run tests cases with CK_NOFORK

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

11 years agoskip tests requiring setenv if none is available
brarcher [Sun, 22 Sep 2013 17:23:00 +0000 (17:23 +0000)]
skip tests requiring setenv if none is available

These tests were not protected by the HAVE_WORKING_SETENV variable,
but needed to be.

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

11 years agoskip test_setup without fork
brarcher [Sun, 22 Sep 2013 17:22:59 +0000 (17:22 +0000)]
skip test_setup without fork

This test is run 3 times, and each run attempts to change some global
memory. If using fork, each test has the same global memory. However,
without fork subsequent tests observe the changed global memory from
previous tests. Disabling all but the first run if there is no fork(),
and the test is invalid without fork.

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

11 years agoDo not run test_early_exit without fork
brarcher [Sun, 22 Sep 2013 17:22:57 +0000 (17:22 +0000)]
Do not run test_early_exit without fork

Without fork(), this test results in exiting a unit test run.
The test is not valid without fork().

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

11 years agoDo not run signal tests without fork()
brarcher [Sun, 22 Sep 2013 17:22:55 +0000 (17:22 +0000)]
Do not run signal tests without fork()

Without fork(), the signal tests are invalid. They result in throwing
different signals, no of which would let a no-fork unit test
run finish. The tests are invalid without fork().

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

11 years agoDo not run test_mark_lno without fork()
brarcher [Sun, 22 Sep 2013 17:22:53 +0000 (17:22 +0000)]
Do not run test_mark_lno without fork()

Previously the test_mark_lno test would run without fork, it just
would not early exit. This let the unit tests run, but did not
let them pass. Without fork(), the test is invalid.

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

11 years agoOnly run timeout tests if fork is available on system
brarcher [Sun, 22 Sep 2013 17:22:52 +0000 (17:22 +0000)]
Only run timeout tests if fork is available on system

Without fork(), these tests cannot run properly anyway, as they
cannot timeout.

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

11 years agoRun fork tests if fork() is defined on system
brarcher [Sun, 22 Sep 2013 17:22:50 +0000 (17:22 +0000)]
Run fork tests if fork() is defined on system

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

11 years agoAdd comments at end of #endif
brarcher [Sun, 22 Sep 2013 17:22:49 +0000 (17:22 +0000)]
Add comments at end of #endif

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

11 years agoMove stdint include to libcompat
brarcher [Sun, 22 Sep 2013 17:22:47 +0000 (17:22 +0000)]
Move stdint include to libcompat

It has a #ifdef surrounding it, it is better to have it in one place
then.

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

11 years agoReplace _POSIX_VERSION with more specific checks
brarcher [Sun, 22 Sep 2013 17:22:45 +0000 (17:22 +0000)]
Replace _POSIX_VERSION with more specific checks

_POSIX_VERSION was used to conditionally compile several posix-only
features. Replacing these with checks for exactly what is needed.

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

11 years agoIf CLOCK_MONOTONIC is not supported, try CLOCK_REALTIME
brarcher [Sat, 21 Sep 2013 17:10:32 +0000 (17:10 +0000)]
If CLOCK_MONOTONIC is not supported, try CLOCK_REALTIME

The cygwin platform (perhaps others) does not support the
CLOCK_MONOTONIC timer. Attempt to use the realtime clock,
and bail out if that also fails.

Fix for bug #88

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

11 years agoUse setitimer in timer_* fallbacks
brarcher [Sat, 21 Sep 2013 16:33:08 +0000 (16:33 +0000)]
Use setitimer in timer_* fallbacks

CCurrently on GNU/Hurd the timer_* functions are not implemented;
check's configure detects that and switches to the replacements
functions in lib/, which use alarm for the timer. However, using
alarm does not allow a timeout precision more than 1 second (as also
written in the comments in lib/timer_settime.c), causing the failure
of the two tests check_check_export and check_check.

As a workaround, it is possible to get a better precision using the
POSIX function setitimer [1] (declared obsolescent, but still usable)
instead of alarm.

This change checks for the existence of setitimer, and in case it
exists uses it (with its ITIMER_REAL timer) in the replacement
timer_settime and timer_delete. Given they are implemented in the
Hurd, all the tests of check passes.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/getitimer.html

Patch submitted by Pino Toscano, patch#49

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

11 years agoUpdate NEWS to mention Check compiles for Windows using MinGW
brarcher [Sat, 21 Sep 2013 16:03:17 +0000 (16:03 +0000)]
Update NEWS to mention Check compiles for Windows using MinGW

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

11 years agoUpdate AUTHORS
brarcher [Sat, 21 Sep 2013 16:03:15 +0000 (16:03 +0000)]
Update AUTHORS

bross had submitted a patch for a few issues compiling for
MinGW. Changes similar to his were put in, though after he
submitted his patch. Giving credit.

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

11 years agoAlways try alternative to tmpfile() if necessary
brarcher [Sat, 21 Sep 2013 16:03:14 +0000 (16:03 +0000)]
Always try alternative to tmpfile() if necessary

If tmpfile fails on a platform, there is no harm in trying the
alternative.

Previously the alternative was only attempted for Windows. However,
checking for WIN32 was not correct; instead _WIN32 should be used.
When the proper check for Windows was attempted, OSX would fail
to run its tests. However, removing the conditional and renaming
_tempnam to tempnam (which is available in MinGW, OSX, and GNU/Linux)
works for all three platforms.

Correctly check for Windows environment

The correct way to check for compiling for Windows is to check for
_WIN32 instead of WIN32.

Patch submitted by username bross on Sourceforge, patch#48

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

11 years agoUse EXEEXT in unit test running scripts
brarcher [Sat, 21 Sep 2013 16:03:11 +0000 (16:03 +0000)]
Use EXEEXT in unit test running scripts

Instead of assuming that the extension of the unit testing programs
is nothing, use EXEEXT to get the actual extension.

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

11 years agoadd EXEEXT to test_vars
brarcher [Sat, 21 Sep 2013 04:00:45 +0000 (04:00 +0000)]
add EXEEXT to test_vars

Some scripts that run unit tests assume that the compiled unit test
programs do not have an extension, which is not always true.
Adding in the EXEEXT variable, which lists what the extension, if
any, is.

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

11 years ago* update index.html from 3.2 to 4.01
cpickett [Thu, 12 Sep 2013 14:39:11 +0000 (14:39 +0000)]
* update index.html from 3.2 to 4.01

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

11 years ago* don't clean check_stdint.h which is generated by configure; bug 90
cpickett [Thu, 12 Sep 2013 14:10:13 +0000 (14:10 +0000)]
* don't clean check_stdint.h which is generated by configure; bug 90

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

11 years agoAdding alarm.c to libcompat
brarcher [Sun, 21 Jul 2013 21:06:55 +0000 (21:06 +0000)]
Adding alarm.c to libcompat

Neglected to add this file in the previous commit

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

11 years agoAdd alarm() to libcompat for platforms that do not define it
brarcher [Sun, 21 Jul 2013 21:06:04 +0000 (21:06 +0000)]
Add alarm() to libcompat for platforms that do not define it

It was noticed in MinGW that alarm() is not defined. Adding it to
libcompat.

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

11 years agoDo a forward declaration of "struct sigevent"
brarcher [Sun, 21 Jul 2013 21:04:58 +0000 (21:04 +0000)]
Do a forward declaration of "struct sigevent"

MinGW does not define "struct sigevent". As check never references
any field inside this, doing a forward declaration does no harm,
and allows MinGW to understand timer_create().

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

11 years agoAdd a missing comment at the end of a #ifdef block
brarcher [Sun, 21 Jul 2013 21:03:20 +0000 (21:03 +0000)]
Add a missing comment at the end of a #ifdef block

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

11 years ago* Update for release
hugo303 [Thu, 18 Apr 2013 09:29:12 +0000 (09:29 +0000)]
* Update for release

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

11 years agoClean check_stdint.h
hugo303 [Thu, 18 Apr 2013 09:27:03 +0000 (09:27 +0000)]
Clean check_stdint.h

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

11 years ago* Update for release
hugo303 [Thu, 18 Apr 2013 08:57:14 +0000 (08:57 +0000)]
* Update for release

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

11 years ago* Update for release
hugo303 [Thu, 18 Apr 2013 08:54:36 +0000 (08:54 +0000)]
* Update for release

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

11 years ago* Update for release
hugo303 [Thu, 18 Apr 2013 08:54:00 +0000 (08:54 +0000)]
* Update for release

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

11 years ago* Update for release
hugo303 [Thu, 18 Apr 2013 08:34:22 +0000 (08:34 +0000)]
* Update for release

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

11 years ago* ignore a bunch of generated files
cpickett [Mon, 25 Feb 2013 09:56:47 +0000 (09:56 +0000)]
* ignore a bunch of generated files

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

11 years ago* rename m4_ax_create_stdint_h.m4 to ax_create_stdint_h.m4
cpickett [Mon, 25 Feb 2013 09:38:37 +0000 (09:38 +0000)]
* rename m4_ax_create_stdint_h.m4 to ax_create_stdint_h.m4
* svn ignore generated check_stdint.h

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

11 years agoAdd to NEWS file
brarcher [Sat, 16 Feb 2013 06:15:40 +0000 (06:15 +0000)]
Add to NEWS file

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

11 years agoUse AC_CREATE_STDINT_H instead of AC_CHECK_HEADERS
brarcher [Sat, 16 Feb 2013 06:04:41 +0000 (06:04 +0000)]
Use AC_CREATE_STDINT_H instead of AC_CHECK_HEADERS

This is based on patch 1174961 from the tracker, submitted by
Travis Spencer.

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

11 years ago* clarify a couple things
cpickett [Tue, 12 Feb 2013 00:00:44 +0000 (00:00 +0000)]
* clarify a couple things

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

11 years ago* clean up AUTHORS, and split lists into maintainers, ex-maintainers,
cpickett [Mon, 11 Feb 2013 23:29:19 +0000 (23:29 +0000)]
* clean up AUTHORS, and split lists into maintainers, ex-maintainers,
  committers, and contributors

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

11 years ago* flip conditionals around in setup_pipe so that it's readable
cpickett [Mon, 11 Feb 2013 22:59:48 +0000 (22:59 +0000)]
* flip conditionals around in setup_pipe so that it's readable
* call new open_tmp_file from setup_pipe instead of tmpfile, to
  make things work on WIN32, closing Bug 3314868

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

11 years ago* fix dead link on web index.html, closing bug 3592019
cpickett [Mon, 11 Feb 2013 21:15:49 +0000 (21:15 +0000)]
* fix dead link on web index.html, closing bug 3592019
* clean up spacing around a couple of other links

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

11 years ago* use AC_SUBST in configure.ac to replace @HAVE_STDINT_H@ in
cpickett [Sat, 9 Feb 2013 00:37:31 +0000 (00:37 +0000)]
* use AC_SUBST in configure.ac to replace @HAVE_STDINT_H@ in
  check.h.in, and define intmax_t and uintmax_t ourselves if it's not
  there, making check.h work with arbitrary clients again.  There is
  probably more of a fix needed for clients that just don't have
  64-bit ints.

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

11 years ago* undo the last change
cpickett [Fri, 8 Feb 2013 21:24:23 +0000 (21:24 +0000)]
* undo the last change

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

11 years ago* take out use of HAVE_CONFIG_H and HAVE_STDINT_H from check.h.in
cpickett [Fri, 8 Feb 2013 21:20:36 +0000 (21:20 +0000)]
* take out use of HAVE_CONFIG_H and HAVE_STDINT_H from check.h.in

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

11 years ago* added note about Automake 1.11.3 on OS X
cpickett [Fri, 8 Feb 2013 20:47:20 +0000 (20:47 +0000)]
* added note about Automake 1.11.3 on OS X

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

11 years ago* Add equivalent uint variants for __ck_assert_int. Patch from bug #3600433
hugo303 [Fri, 8 Feb 2013 14:43:06 +0000 (14:43 +0000)]
* Add equivalent uint variants for __ck_assert_int. Patch from bug #3600433

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

11 years ago* Support 64bit int for __ck_assert_int. Patch from bug #3599471
hugo303 [Fri, 8 Feb 2013 14:23:01 +0000 (14:23 +0000)]
* Support 64bit int for __ck_assert_int. Patch from bug #3599471

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

11 years ago* Autoconf support for uint32_t. Patch from bug #3600421
hugo303 [Fri, 8 Feb 2013 14:10:51 +0000 (14:10 +0000)]
* Autoconf support for uint32_t. Patch from bug #3600421

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

11 years ago* Fix compatibility with automake older than 1.12
hugo303 [Fri, 8 Feb 2013 14:04:28 +0000 (14:04 +0000)]
* Fix compatibility with automake older than 1.12

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

11 years ago* fix up description of how ck_assert_msg behaves
cpickett [Wed, 6 Feb 2013 21:09:03 +0000 (21:09 +0000)]
* fix up description of how ck_assert_msg behaves

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

11 years ago* replace ck_assert with ck_assert_msg
cpickett [Wed, 6 Feb 2013 20:52:15 +0000 (20:52 +0000)]
* replace ck_assert with ck_assert_msg

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

11 years agoOnly add -lm if the floor function is in the math lib.
brarcher [Thu, 31 Jan 2013 23:40:47 +0000 (23:40 +0000)]
Only add -lm if the floor function is in the math lib.

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

11 years agoAdd comment explaining snprintf checks
brarcher [Thu, 31 Jan 2013 23:40:29 +0000 (23:40 +0000)]
Add comment explaining snprintf checks

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

11 years agoAdd C99 compliant snprintf to libcompat
brarcher [Thu, 31 Jan 2013 22:49:40 +0000 (22:49 +0000)]
Add C99 compliant snprintf to libcompat

Many systems do not provide a C99 compliant snprintf implementation.
To guarantee that the snprintf used by parts of check is correct,
a version is added to libcompat. The system's snprintf is checked with
the configure script. If the system's snprintf is not up to snuff,
the libcompat version is used.

This version of snprintf is from Holger Weiß and Patrick Powell.
http://www.jhweiss.de/software/snprintf.html

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

11 years agoFix typo in header file
brarcher [Wed, 30 Jan 2013 05:08:49 +0000 (05:08 +0000)]
Fix typo in header file

Should read that ck_assert aborts the test if the condition is
false, not true.

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