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

11 years agocheck_check_fixture: free suite runners when finished
brarcher [Tue, 17 Dec 2013 22:12:26 +0000 (22:12 +0000)]
check_check_fixture: free suite runners when finished

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

11 years agocheck_check_msg: use proper free for TestResult
brarcher [Tue, 17 Dec 2013 22:12:25 +0000 (22:12 +0000)]
check_check_msg: use proper free for TestResult

The TestResult was being freed, but not all the points to
live data it was holding.

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

11 years agocreate function for freeing a TestResult
brarcher [Tue, 17 Dec 2013 22:12:23 +0000 (22:12 +0000)]
create function for freeing a TestResult

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

11 years agofix potential leaks when assigning result message
brarcher [Tue, 17 Dec 2013 22:12:20 +0000 (22:12 +0000)]
fix potential leaks when assigning result message

In some cases, a result message has already been allocated,
which is then overwritten by set_fork_info(). Just in case,
check if tr->msg is not null, and if so free the value, before
assigning a new value.

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

11 years agoAdd comment, mentioning time resolution of stored duration
brarcher [Tue, 17 Dec 2013 22:12:17 +0000 (22:12 +0000)]
Add comment, mentioning time resolution of stored duration

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

11 years agoMove NANOS_PER_SECONDS to check_impl.h with other time defines
brarcher [Tue, 17 Dec 2013 22:12:15 +0000 (22:12 +0000)]
Move NANOS_PER_SECONDS to check_impl.h with other time defines

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

11 years agoAdd #define for US_PER_SEC, to avoid magic numbers
brarcher [Tue, 17 Dec 2013 22:12:12 +0000 (22:12 +0000)]
Add #define for US_PER_SEC, to avoid magic numbers

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

11 years agoAdd *.tap to CLEANFILES
brarcher [Tue, 17 Dec 2013 16:42:04 +0000 (16:42 +0000)]
Add *.tap to CLEANFILES

Otherwise, make preleasecheck will fail due to the extra test.tap
file.

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

11 years agoadd test_tap_output.sh to EXTRA_DIST
brarcher [Tue, 17 Dec 2013 16:42:03 +0000 (16:42 +0000)]
add test_tap_output.sh to EXTRA_DIST

Otherwise, the preleasecheck target will not pass

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

11 years agodoc: add link to TAP specification.
brarcher [Tue, 17 Dec 2013 16:42:01 +0000 (16:42 +0000)]
doc: add link to TAP specification.

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

11 years agoAdd unit tests for TAP logging setup functions
brarcher [Tue, 17 Dec 2013 16:07:15 +0000 (16:07 +0000)]
Add unit tests for TAP logging setup functions

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

11 years agoAlways remove test output before running new test
brarcher [Tue, 17 Dec 2013 16:07:14 +0000 (16:07 +0000)]
Always remove test output before running new test

Just in case the output is left over from the previous test run

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

11 years agouse variable OUTPUT_FILE for tests that check logging output
brarcher [Tue, 17 Dec 2013 16:07:11 +0000 (16:07 +0000)]
use variable OUTPUT_FILE for tests that check logging output

This is better than hard coding the name throghout the test

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

11 years agoadd support for descriptions in TAP logging
brarcher [Tue, 17 Dec 2013 16:07:10 +0000 (16:07 +0000)]
add support for descriptions in TAP logging

The description on a TAP output line is as follows:

[not] ok (number) - (file):(suite name):(test name): (message)

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

11 years agoNEWS: mention logging support for TAP
brarcher [Tue, 17 Dec 2013 16:07:07 +0000 (16:07 +0000)]
NEWS: mention logging support for TAP

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

11 years agodoc: update to mention TAP logging
brarcher [Tue, 17 Dec 2013 16:07:05 +0000 (16:07 +0000)]
doc: update to mention TAP logging

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

11 years agoAdd steps to release for updating index.html page
brarcher [Tue, 17 Dec 2013 16:07:03 +0000 (16:07 +0000)]
Add steps to release for updating index.html page

The latest release information will need to be updated
on the index.html landing page whenever check has a release.

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

11 years agoAdd make target for updating check's landing page
brarcher [Tue, 17 Dec 2013 16:07:01 +0000 (16:07 +0000)]
Add make target for updating check's landing page

Just in case one wants to update the webpage between releases.

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

11 years agoseparate releasevars into two tasks for version and username
brarcher [Tue, 17 Dec 2013 16:07:00 +0000 (16:07 +0000)]
separate releasevars into two tasks for version and username

This way, other tasks can check for just one of these.

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

11 years agoAdd to NEWS information on refactoring check's asserts
brarcher [Tue, 17 Dec 2013 16:06:58 +0000 (16:06 +0000)]
Add to NEWS information on refactoring check's asserts

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

11 years agospacing
brarcher [Tue, 17 Dec 2013 16:06:57 +0000 (16:06 +0000)]
spacing

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

11 years agoAdd comments on the meanings of the logging events
brarcher [Tue, 17 Dec 2013 16:06:55 +0000 (16:06 +0000)]
Add comments on the meanings of the logging events

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

11 years agoAdd tests for tap logging
brarcher [Tue, 17 Dec 2013 16:06:53 +0000 (16:06 +0000)]
Add tests for tap logging

These tests follow closely with what the logging tests cover, with
one small change. If fork() is disabled, one test case will
invoked exit() and cause the unit testing program to terminate
early. In that case, the tap output is expected to be incomplete.

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

11 years agoadd support for logging in TAP format
brarcher [Tue, 17 Dec 2013 16:06:50 +0000 (16:06 +0000)]
add support for logging in TAP format

Logging in the Test Anything Protcol (TAP) format is useful
in general, but is especially useful on platforms where
fork() is unavailable. The TAP format requires that the
planned number of tests to run be specified, either at the
start or end of a test run. If the number of tests run does not
match the plan, the test run is marked as failed. As running
without fork() leaves the unit testing program open to failure
if a test aborts/segfaults/etc, validating the TAP output is
useful.

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

11 years agoremove stray ;
brarcher [Tue, 17 Dec 2013 16:06:48 +0000 (16:06 +0000)]
remove stray ;

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

11 years agocheck.h: only mark _ck_assert_failed as noreturn when using fork
brarcher [Tue, 17 Dec 2013 03:28:26 +0000 (03:28 +0000)]
check.h: only mark _ck_assert_failed as noreturn when using fork

When fork is used, _ck_assert_failed will call exit() when a
failure occurs. Marking it as noreturn makes sense in this case.

When fork() is not used, longjmp() is called, which is a type of
return. Marking it as noreturn allows the compiler (gcc) to
make assumptions which are not true. Using longjmp causes
the unit testing program to segfault.

For this reason, the function is only marked as noreturn when
using fork(). Any static source code analysis to catch issues
must be done on a system with fork() to avoid possible false
positives.

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

11 years agochange how assertions are called, to support source code analyzers
brarcher [Mon, 16 Dec 2013 23:27:14 +0000 (23:27 +0000)]
change how assertions are called, to support source code analyzers

The assert functions that check provides are really macros that
funnel down to the _ck_assert_msg() function. That function receives
the result from the operation being checked, then decides if the unit
test should continue or should halt.

The assert function in C is sometimes also a macro. For example, the
following:

void foo(int *p)
{
   assert(p != NULL);
}

on OSX when preprocessed actually becomes:

void foo(int *p)
{
   (_builtin_expect(!(p != NULL), 0) ? __assert_rtn(__func_, "t.c", 4, "p != NULL") : (void)0);
}

The __assert_rtn function is marked as "noreturn", and only gets invoked
when an assertion has failed. Because it only gets called when something
bad has happened, static code analysis can reason about when it is and is
not called, and make assumptions about the code being compiled.

To the point, this change refactors check's assert macros in such a way
that they result in a function being called only when the assertion
fails, and thus static code analyzers (such as clang's scan-build tool)
can reason when something is possible and impossible in test code. As a
result, if one wanted to run static analysis on unit test code, there
would be far fewer false positives.

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

11 years agoweb: change link font size to be identical to left pane text size
brarcher [Mon, 16 Dec 2013 23:27:11 +0000 (23:27 +0000)]
web: change link font size to be identical to left pane text size

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

11 years agodoc: make it clear that autotools is not necessary to use check
brarcher [Mon, 16 Dec 2013 21:35:14 +0000 (21:35 +0000)]
doc: make it clear that autotools is not necessary to use check

Autotools is used to build Check, but it is not necessary
to use autotools for unit tests linked against Check.

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

11 years agoweb: add banner for CloudBees, and link at bottom of page
brarcher [Mon, 16 Dec 2013 21:23:23 +0000 (21:23 +0000)]
web: add banner for CloudBees, and link at bottom of page

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

11 years agoweb: add tab to tutorial
brarcher [Mon, 16 Dec 2013 21:17:42 +0000 (21:17 +0000)]
web: add tab to tutorial

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

11 years agocheck.texi: add border around all source file examples
brarcher [Mon, 16 Dec 2013 16:29:36 +0000 (16:29 +0000)]
check.texi: add border around all source file examples

The border (cartouche) around the source code listings
makes it a little easier to figure out where the
example starts and stops.

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

11 years agoweb: change layout of landing page
brarcher [Mon, 16 Dec 2013 16:29:34 +0000 (16:29 +0000)]
web: change layout of landing page

Instead of a plain black/white page with text, the new layout
contains some color, a side pane with links and info on the
latest release, and some links.

All data related to the page is in the new subfolder "web".

The layout was from Open Source Web Design (oswd.org), and is
the NewsPortal layout by "Designs by Darren".

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

11 years agocheck_check_pack: remove unnecessary assignment
brarcher [Mon, 16 Dec 2013 16:29:27 +0000 (16:29 +0000)]
check_check_pack: remove unnecessary assignment

clang's scan-build static analyzer pointed out that the
assignment was unnecessary, as was ignored.

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

11 years agoMove Branden Archer to the maintainer's list
brarcher [Sat, 7 Dec 2013 05:05:17 +0000 (05:05 +0000)]
Move Branden Archer to the maintainer's list

Branden is now a maintainer.

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

11 years agofix ck_assert_ptr_* causing const compilation warnings
brarcher [Sat, 7 Dec 2013 05:05:15 +0000 (05:05 +0000)]
fix ck_assert_ptr_* causing const compilation warnings

A test sequence such as:

const struct my_vtable expected_element;
struct my_vtable* test_element;
ck_assert_ptr_eq(test_element, &expected_element);

Compiled using gcc 4.7.2 with -Wall gives the following warning.
myfile.c:70:2: warning: initialization discards â€˜const’ qualifier from pointer target type [enabled by default]

Adding a const qualifier to the variables in the _ck_assert_ptr macro,
as done for _ck_assert_str makes the problem go away.

Issue #91, patch submitted by user lordlod24.

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

11 years agorestore development header to NEWS
brarcher [Tue, 5 Nov 2013 03:02:01 +0000 (03:02 +0000)]
restore development header to NEWS

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

11 years ago* Update for release
brarcher [Tue, 5 Nov 2013 02:12:17 +0000 (02:12 +0000)]
* Update for release

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

11 years agotest*_output.sh: append SRCDIR to filenames
brarcher [Tue, 5 Nov 2013 02:09:21 +0000 (02:09 +0000)]
test*_output.sh: append SRCDIR to filenames

In case check is built out-of-tree, the SRCDIR is appended to
filenames. This will prevent a false-positive unit tests failures.

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

11 years agoadd check_stdint.h to DISTCLEANFILES
brarcher [Tue, 5 Nov 2013 02:09:19 +0000 (02:09 +0000)]
add check_stdint.h to DISTCLEANFILES

check_stdint.h should be cleaned during the distclean-generic make target,
but not the clean make target.

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

11 years agotest_vars: grab the srcdir variable
brarcher [Tue, 5 Nov 2013 02:09:17 +0000 (02:09 +0000)]
test_vars: grab the srcdir variable

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

11 years agoAdd a .gitignore file
brarcher [Tue, 5 Nov 2013 02:09:15 +0000 (02:09 +0000)]
Add a .gitignore file

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

11 years agoupdate svn URL in release process
brarcher [Tue, 5 Nov 2013 02:09:13 +0000 (02:09 +0000)]
update svn URL in release process

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

11 years ago* Update for release
brarcher [Wed, 30 Oct 2013 03:22:55 +0000 (03:22 +0000)]
* Update for release

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