]> granicus.if.org Git - check/log
check
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

11 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

11 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

11 years agocheck_msg.c: make open_tmp_file not static
brarcher [Wed, 25 Dec 2013 03:04:56 +0000 (03:04 +0000)]
check_msg.c: make open_tmp_file not static

The pack unit tests will need to have a way to create a
temporary file. Allowing them to use open_tmp_file is
simpler.

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

11 years agocheck_check_exit: remove unnecessary unistd.h include
brarcher [Wed, 25 Dec 2013 03:04:55 +0000 (03:04 +0000)]
check_check_exit: remove unnecessary unistd.h include

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

11 years agolibcompat: if _snprintf is available instead, us it
brarcher [Wed, 25 Dec 2013 03:04:53 +0000 (03:04 +0000)]
libcompat: if _snprintf is available instead, us it

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

11 years agocmake: use libcompat's snprintf if not available on system
brarcher [Wed, 25 Dec 2013 03:04:51 +0000 (03:04 +0000)]
cmake: use libcompat's snprintf if not available on system

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

11 years agocmake: add check for struct itimerspec for MSVC
brarcher [Wed, 25 Dec 2013 03:04:48 +0000 (03:04 +0000)]
cmake: add check for struct itimerspec for MSVC

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

11 years agoclock_gettime: remove some header includes, they are in libcompat.h
brarcher [Wed, 25 Dec 2013 03:04:47 +0000 (03:04 +0000)]
clock_gettime: remove some header includes, they are in libcompat.h

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

11 years agocmake: add checks for librt functions
brarcher [Wed, 25 Dec 2013 03:04:46 +0000 (03:04 +0000)]
cmake: add checks for librt functions

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

11 years agomodify how HAVE_FORK is determined in code
brarcher [Wed, 25 Dec 2013 03:04:44 +0000 (03:04 +0000)]
modify how HAVE_FORK is determined in code

autotools will define HAVE_FORK only if fork is available.
cmake can do the same thing on Linux, however on Windows
the only way to get HAVE_FORK to appear is to make it always
appear and contain a value. To support both autotools and
cmake, change the compile time check slightly to check that
HAVE_FORK is 1.

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

11 years agoAdd paren around if block
brarcher [Wed, 25 Dec 2013 03:04:41 +0000 (03:04 +0000)]
Add paren around if block

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

11 years agoFix fileno(get_pipe()) for MSVC
brarcher [Wed, 25 Dec 2013 03:04:39 +0000 (03:04 +0000)]
Fix fileno(get_pipe()) for MSVC

MSVC is unable to parse the code:
  fileno(get_pipe())
when directly as an argument for ppack() or punpack(). This may
be because fileno() is replaced with _fileno() in a #define.

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

11 years agocmake: only replace libcompat if all possibilities on system are missing
brarcher [Wed, 25 Dec 2013 03:04:38 +0000 (03:04 +0000)]
cmake: only replace libcompat if all possibilities on system are missing

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

11 years agocmake: add check for struct timespec for windows
brarcher [Wed, 25 Dec 2013 03:04:36 +0000 (03:04 +0000)]
cmake: add check for struct timespec for windows

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

11 years agocmake: add content to endifs
brarcher [Wed, 25 Dec 2013 03:04:34 +0000 (03:04 +0000)]
cmake: add content to endifs

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

11 years agocmake: add check for clockid_t
brarcher [Wed, 25 Dec 2013 03:04:33 +0000 (03:04 +0000)]
cmake: add check for clockid_t

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

11 years agocmake: use set() to set HAVE_FORK variable
brarcher [Wed, 25 Dec 2013 03:04:31 +0000 (03:04 +0000)]
cmake: use set() to set HAVE_FORK variable

In Windows, the add_definitions() call does not set the
HAVE_FORK variable for configuration files (check.h.in, test_var.in).

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

11 years agocmake: set HAVE_FORK=0 if fork is unavailable
brarcher [Wed, 25 Dec 2013 03:04:30 +0000 (03:04 +0000)]
cmake: set HAVE_FORK=0 if fork is unavailable

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

11 years agocmake: enable remaining tests
brarcher [Wed, 25 Dec 2013 03:04:28 +0000 (03:04 +0000)]
cmake: enable remaining tests

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

11 years agocmake: set srcdir env var for shell script test runners
brarcher [Wed, 25 Dec 2013 03:04:27 +0000 (03:04 +0000)]
cmake: set srcdir env var for shell script test runners

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

11 years agocmake: detect floor in math lib, as that is what is being used
brarcher [Wed, 25 Dec 2013 03:04:26 +0000 (03:04 +0000)]
cmake: detect floor in math lib, as that is what is being used

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

11 years agocmake: enable unit testing with check_check
brarcher [Wed, 25 Dec 2013 03:04:25 +0000 (03:04 +0000)]
cmake: enable unit testing with check_check

To invoke the tests, type:
$ make test

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

11 years agocmake: generate test_vars file for sh script tests
brarcher [Wed, 25 Dec 2013 03:04:24 +0000 (03:04 +0000)]
cmake: generate test_vars file for sh script tests

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

11 years agocmake: add check for subunit
brarcher [Wed, 25 Dec 2013 03:04:22 +0000 (03:04 +0000)]
cmake: add check for subunit

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

11 years agolibcompat.h: Correct HAVE_SETENV
brarcher [Wed, 25 Dec 2013 03:04:20 +0000 (03:04 +0000)]
libcompat.h: Correct HAVE_SETENV

The configure.ac script will set HAVE_DECL_SETENV if setenv exists.
This must not have been working, as no setenv tests must have
been executing.

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

11 years agocmake: always compile in memory leaking tests
brarcher [Wed, 25 Dec 2013 03:04:19 +0000 (03:04 +0000)]
cmake: always compile in memory leaking tests

The check_mem_leaks is not configured to compile with cmake.
As the target for cmake is Windows, and Windows does not have
a valgrind that will work, there is no point in supporting
it.

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

11 years agocmake: define HAVE_FORK if fork is detected
brarcher [Wed, 25 Dec 2013 03:04:18 +0000 (03:04 +0000)]
cmake: define HAVE_FORK if fork is detected

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

11 years agocmake: remove TIMEOUT_TESTS_ENABLE=0
brarcher [Wed, 25 Dec 2013 03:04:16 +0000 (03:04 +0000)]
cmake: remove TIMEOUT_TESTS_ENABLE=0

Check will determine if it can run time timeout tests, and which
ones, based on HAVE_FORK and HAVE_LIBRT.

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

11 years agoadd clock_t & timer_t to configure.ac and CMakeLists.txt instead
brarcher [Wed, 25 Dec 2013 03:04:14 +0000 (03:04 +0000)]
add clock_t & timer_t to configure.ac and CMakeLists.txt instead

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

11 years agoIf CK_FORK_GETENV is set, only set CK_FORK if HAVE_FORK
brarcher [Wed, 25 Dec 2013 03:04:12 +0000 (03:04 +0000)]
If CK_FORK_GETENV is set, only set CK_FORK if HAVE_FORK

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

11 years agolibcompat.h: include sys/time.h only if it is available
brarcher [Wed, 25 Dec 2013 03:04:10 +0000 (03:04 +0000)]
libcompat.h: include sys/time.h only if it is available

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

11 years agolibcompat: add alternative for gettimeofday
brarcher [Wed, 25 Dec 2013 03:04:09 +0000 (03:04 +0000)]
libcompat: add alternative for gettimeofday

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

11 years agolibcompat.h: rename several functions if the _ variant exists
brarcher [Wed, 25 Dec 2013 03:04:07 +0000 (03:04 +0000)]
libcompat.h: rename several functions if the _ variant exists

For fileno, getpid, pipe, putenv, read, strdup, and write,
if the name append with _ exists, use that instead.
This likely only applied to MSVC.

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

11 years agolibcompat.h: Include additional headers if MSVC
brarcher [Wed, 25 Dec 2013 03:04:06 +0000 (03:04 +0000)]
libcompat.h: Include additional headers if MSVC

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

11 years agosleep.c: use Sleep() if MSVC
brarcher [Wed, 25 Dec 2013 03:04:04 +0000 (03:04 +0000)]
sleep.c: use Sleep() if MSVC

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

11 years agolocaltime_r.c: provide additional alternatives
brarcher [Wed, 25 Dec 2013 03:04:02 +0000 (03:04 +0000)]
localtime_r.c: provide additional alternatives

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

11 years agospacing
brarcher [Wed, 25 Dec 2013 03:04:00 +0000 (03:04 +0000)]
spacing

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

11 years agoInitial commit of cmake support, based on mloskot patch
brarcher [Wed, 25 Dec 2013 03:03:58 +0000 (03:03 +0000)]
Initial commit of cmake support, based on mloskot patch

This commit is likely not functional yet. More changes
on the way for complete cmake support

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

11 years agotest_xml_output: add tests for valid duration for tests
brarcher [Mon, 23 Dec 2013 16:29:42 +0000 (16:29 +0000)]
test_xml_output: add tests for valid duration for tests

This is to check for the case where the duration is not -1
or in [0, CK_DEFAULT_TIMEOUT]. There was an issue with NO_FORK
mode where the duration was not valid.

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

11 years agomove clock_gettime calls outside of setjmp context for NO_FORK mode
brarcher [Mon, 23 Dec 2013 15:48:37 +0000 (15:48 +0000)]
move clock_gettime calls outside of setjmp context for NO_FORK mode

The test duration was getting smashed if tests failed in NO_FORK
mode. If the setjmp() function was used to abort a test, the end
time would not get captured. This resulted in arbitrary numbers
being written for the test's duration.

This change moves the settime() calls outside of the setjmp() context,
so the times get captured if the test passes or fails.

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

11 years agoweb: remove mention that unit tests fail on GNU/Hurd
brarcher [Sun, 22 Dec 2013 04:59:41 +0000 (04:59 +0000)]
web: remove mention that unit tests fail on GNU/Hurd

The issue was resolved, and the checkmk unit tests now pass.

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

11 years agocheckmk: change POSIX bracket expressions to be compatible with GNU/Hurd
brarcher [Sun, 22 Dec 2013 04:59:37 +0000 (04:59 +0000)]
checkmk: change POSIX bracket expressions to be compatible with GNU/Hurd

The version of mawk included in Hurd is quite old (at least 8 years)
and did not support the bracket extensions previously used.

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

11 years agoHACKING: Add information on updating just the website
brarcher [Sat, 21 Dec 2013 04:50:46 +0000 (04:50 +0000)]
HACKING: Add information on updating just the website

If Check's website needs to be updated between releases,
these instructions can be used.

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

11 years agoweb: Mention Install page in Supported Platforms section
brarcher [Sat, 21 Dec 2013 04:16:56 +0000 (04:16 +0000)]
web: Mention Install page in Supported Platforms section

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

11 years agoweb: mention GNU/Hurd and BSD in Supported Platforms section
brarcher [Sat, 21 Dec 2013 04:16:53 +0000 (04:16 +0000)]
web: mention GNU/Hurd and BSD in Supported Platforms section

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

11 years agoweb: set style for lists
brarcher [Sat, 21 Dec 2013 00:05:04 +0000 (00:05 +0000)]
web: set style for lists

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

11 years agoweb: add install page, describing how to install Check
brarcher [Sat, 21 Dec 2013 00:05:01 +0000 (00:05 +0000)]
web: add install page, describing how to install Check

This page describes how to install Check on various
platforms, either through a package manager or from source.

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

11 years agolibrt_timers.m4: use prev behavior when cross compiling
brarcher [Sat, 21 Dec 2013 00:04:59 +0000 (00:04 +0000)]
librt_timers.m4: use prev behavior when cross compiling

In the case where we are cross compiling, the POSIX detection of
the timer_create() function is skipped, and instead the usual check
for the existence of all the timer_* functions is done using
AC_REPLACE_FUNCS.

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

11 years agoindex.html: Add link for browsing current Check source
brarcher [Sat, 21 Dec 2013 00:04:56 +0000 (00:04 +0000)]
index.html: Add link for browsing current Check source

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

11 years agoDo not include memory leaking tests in check_mem_leaks
brarcher [Thu, 19 Dec 2013 19:47:11 +0000 (19:47 +0000)]
Do not include memory leaking tests in check_mem_leaks

check_mem_leaks is to be used with valgrind. That will check
if Check is leaking memory. Having tests that also intentionally
leak will give false positives.

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

11 years agoMark the test_null unit test as leaking memory
brarcher [Thu, 19 Dec 2013 19:47:07 +0000 (19:47 +0000)]
Mark the test_null unit test as leaking memory

This test calls a few Check functions, seeing if something bad
will happen. In the process, they leak some memory.

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

11 years agoAdd #define for disabling unit tests that intentionally leak memory
brarcher [Thu, 19 Dec 2013 19:47:04 +0000 (19:47 +0000)]
Add #define for disabling unit tests that intentionally leak memory

Some tests intentionally leak memory. Usually this is not a concern.
However, we want to run some of our tests against valgrind, to make
sure that Check itself is not leaking any memory. To enable this,
the tests that intentionally leak memory will be conditionally
compiled out when building a unit tests program for use with
valgrind.

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

11 years agoremove check_mem_leaks from "make check"
brarcher [Thu, 19 Dec 2013 16:48:27 +0000 (16:48 +0000)]
remove check_mem_leaks from "make check"

when run locally, all is well. Unit tests pass, and
valgrind says there is nothing wrong. When run on
some GNU/Linux build slave machine, running the unit test
dies with an invalid pointer free.

Will need to figure out how to reproduce this locally to
continue.

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

11 years agotry to add check_mem_leaks back into "make check"
brarcher [Thu, 19 Dec 2013 16:27:54 +0000 (16:27 +0000)]
try to add check_mem_leaks back into "make check"

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

11 years agotest_mem_leaks.sh: use libtool to invoke check_mem_leaks
brarcher [Thu, 19 Dec 2013 16:27:53 +0000 (16:27 +0000)]
test_mem_leaks.sh: use libtool to invoke check_mem_leaks

The libtool documentation says the proper way to invoke the
compiled program before it is installed is to use libtool.

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

11 years agocheck_mem_leaks: trim down to only use libcheck
brarcher [Thu, 19 Dec 2013 16:27:51 +0000 (16:27 +0000)]
check_mem_leaks: trim down to only use libcheck

Previously the unit tests was linking against libcheckinternal.

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

11 years agoRemove check_mem_leaks from "make check"
brarcher [Thu, 19 Dec 2013 16:02:03 +0000 (16:02 +0000)]
Remove check_mem_leaks from "make check"

All my local systems will compile and run check_mem_leaks without
issue. However, the build slaves are all unable to run it, for
various reasons.

For now, removing it from "make check" to prevent someone's build for
failing for no good reason. Will revisit this once more is known.

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

11 years agoAdd check_mem_leaks.sh to EXTRA_DIST
brarcher [Thu, 19 Dec 2013 16:01:59 +0000 (16:01 +0000)]
Add check_mem_leaks.sh to EXTRA_DIST

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

11 years agoNEWS: add lines near the top that happen to mention 0.9.11
brarcher [Thu, 19 Dec 2013 04:31:49 +0000 (04:31 +0000)]
NEWS: add lines near the top that happen to mention 0.9.11

The distcheck target requires that the current version,
0.9.11, appear in the first 15 lines. After enough stuff
was added to NEWS, this broke, and the prereleasecheck
target (which uses distcheck) no longer worked.

These lines will have to be removed before the next release.

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

11 years agoNEWS: update with recent additions
brarcher [Wed, 18 Dec 2013 23:03:11 +0000 (23:03 +0000)]
NEWS: update with recent additions

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

11 years agoindex.html: mention OpenBSD support.
brarcher [Wed, 18 Dec 2013 23:03:09 +0000 (23:03 +0000)]
index.html: mention OpenBSD support.

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

11 years agoconfigure.ac: use the librt_timer.m4 checks
brarcher [Wed, 18 Dec 2013 23:03:08 +0000 (23:03 +0000)]
configure.ac: use the librt_timer.m4 checks

Hopefully with this the default ./configure will
work on OpenBSD.

Note that --enable-timer-replacement will still override the
check, resulting the Check's replacements being used.

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

11 years agolibrt_timers.m4: check if timer_create() is usable
brarcher [Wed, 18 Dec 2013 23:03:06 +0000 (23:03 +0000)]
librt_timers.m4: check if timer_create() is usable

Adds a custom check for the timer_create() function on the target
system.

It was found that on OpenBSD, the timer_create(), timer_settime(),
and timer_delete() functions were only stubbed out. They set
errno to ENOSYS and return -1. To detect this and replace the timer_*
functions with libcompat's, this m4 file will execute a test
program on the system, checking for the ENOSYS errno.

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

11 years agotest_mem_leak.sh: add convenience script for running valgrind
brarcher [Wed, 18 Dec 2013 21:37:11 +0000 (21:37 +0000)]
test_mem_leak.sh: add convenience script for running valgrind

This script will run valgrind against check_mem_leaks, and
determine if there are any memory leaks.

This is not run as part of "make check", as valgrind really only works
on GNU/Linux. (It is available on OSX, but does not really work).

We will need to run this ourselves (or from our continuous integration
server) to periodically check for leaks.

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

11 years agocheck_mem_leaks: add new unit test for use against valgrind
brarcher [Wed, 18 Dec 2013 21:37:09 +0000 (21:37 +0000)]
check_mem_leaks: add new unit test for use against valgrind

The purpose of this test is to be used by valgrind to check for
memory leaks. Each public API that check exports is used at
least once. Tests which use non-public API, or leak intentionally,
are not included here.

The test should pass when run, and is added to the list of tests to
run with "make check".

Actually using valgrind to check for memory leaks is outside of its
running with "make check". One still would need to manually run
valgrind.

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

11 years agoconfigure.ac: add option to force Check's replacement of timer_* functions
brarcher [Wed, 18 Dec 2013 19:46:56 +0000 (19:46 +0000)]
configure.ac: add option to force Check's replacement of timer_* functions

On OpenBSD 5.4 (and perhaps other BSDs) the timer_* functions
are implemented, but do nothing. Instead, they set errno to
ENOSYS (not available) and return -1. Check would check if
the timer_* functions were missing, and would use its own
replacements if they were. However, because they actually do
exist, Check does not know to replace them.

This adds another configure option, --enable-timer-replacement, which
will force Check's timer replacements instead of detecting the need.
There is still no checking if the replacements are needed or not
for OpenBSD, but at least this gives an option so check will work
properly.

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

11 years ago.gitignore: remove checkmk, but add CMakeLists.txt
brarcher [Wed, 18 Dec 2013 19:46:54 +0000 (19:46 +0000)]
.gitignore: remove checkmk, but add CMakeLists.txt

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

11 years agocheckmk: tcase_add_loop_test support in checkmk
brarcher [Wed, 18 Dec 2013 19:46:52 +0000 (19:46 +0000)]
checkmk: tcase_add_loop_test support in checkmk

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

11 years agocheck_run: add parenthesis
brarcher [Tue, 17 Dec 2013 22:12:28 +0000 (22:12 +0000)]
check_run: add parenthesis

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