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

11 years agoUpdate for release
brarcher [Wed, 30 Oct 2013 03:18:17 +0000 (03:18 +0000)]
Update for release

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

11 years agoTODO: note Cygwin and MinGW support for v0.9.11
brarcher [Wed, 30 Oct 2013 03:13:20 +0000 (03:13 +0000)]
TODO: note Cygwin and MinGW support for v0.9.11

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

11 years agoNEWS: add info on support for MinGW/msys environment on Windows
brarcher [Thu, 24 Oct 2013 02:14:57 +0000 (02:14 +0000)]
NEWS: add info on support for MinGW/msys environment on Windows

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

11 years agochange check for valid clockid
brarcher [Thu, 24 Oct 2013 02:14:55 +0000 (02:14 +0000)]
change check for valid clockid

cygwin does not support CLOCK_MONOTONIC. However, a call to
clock_gettime(CLOCK_MONOTONIC, ...) will pass, whereas
a timer_create(CLOCK_MONOTONIC, ...) will fail. Use the
timer_create() call for the check instead.

However, be careful to only make the check if librt is available,
otherwise it is a waste. Or worse, if librt and alarm() are
unavailable, a timer_delete() will result in an assert(0).

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

11 years agoconfigure.ac: do not compile with -ansi for now
brarcher [Mon, 21 Oct 2013 03:26:29 +0000 (03:26 +0000)]
configure.ac: do not compile with -ansi for now

There is currently a bug on the MinGW/MinGW-w64 platforms:
   sourceforge.net/p/mingw/bugs/2024
where compiling with -ansi will not define the off64_t type,
but including unistd.h will require it to be defined else
a compile error will result.

Attempting to define a replacement in config.h also fails; config.h
will work for check's code, but the code that libtool produces
then fails, meaning unit tests fail to compile.

When the MinGW bug is resolved, we can start compiling with -ansi again.

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

11 years agoconfigure.ac: also use pthread.h for time struct checks
brarcher [Mon, 21 Oct 2013 03:26:27 +0000 (03:26 +0000)]
configure.ac: also use pthread.h for time struct checks

In MinGW and MinGW-w64, the timespec and itimerspec structs
are defined in pthread.h instead of time.h. To properly
check for this, we now also will include pthread.h if it is
available on the system.

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

11 years agoconfigure.ac: move pthread check earlier
brarcher [Mon, 21 Oct 2013 03:26:26 +0000 (03:26 +0000)]
configure.ac: move pthread check earlier

The time checks will need to know if pthread exists in
a future commit.

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

11 years agocheck_check_exit.c: Include libcompat.h
brarcher [Mon, 21 Oct 2013 03:26:24 +0000 (03:26 +0000)]
check_check_exit.c: Include libcompat.h

for consistency

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

11 years agoconfigure.ac: remove left over debug
brarcher [Mon, 21 Oct 2013 03:26:22 +0000 (03:26 +0000)]
configure.ac: remove left over debug

oops, forgot to remove debug before checking in.

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

11 years agosnprintf: disable 'long long', as is not supported in C90
brarcher [Mon, 14 Oct 2013 23:03:27 +0000 (23:03 +0000)]
snprintf: disable 'long long', as is not supported in C90

-Wlong-long warns that C90 does not support the 'long long' data type.
However, the snprintf replacement provides support for it. As
check does not use long long anywhere, and also does not
use it to print anything, references to the data types are removed
from the snprintf replacement.

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

11 years agosnprintf: remove missing default case warning
brarcher [Mon, 14 Oct 2013 23:03:25 +0000 (23:03 +0000)]
snprintf: remove missing default case warning

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

11 years agosnprintf: removing missing prototype warnings
brarcher [Mon, 14 Oct 2013 23:03:21 +0000 (23:03 +0000)]
snprintf: removing missing prototype warnings

These prototypes are all in libcompat.h, and as there is no need
for this file to include libcompat.h, the missing headers are
put into this file.

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

11 years agoFix enable_fork check
brarcher [Mon, 14 Oct 2013 23:03:19 +0000 (23:03 +0000)]
Fix enable_fork check

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

11 years agoAdd configure option to force snprintf replacement
brarcher [Mon, 14 Oct 2013 23:03:17 +0000 (23:03 +0000)]
Add configure option to force snprintf replacement

The configure argument --enable-snprintf-replacement will be used
for force the snprintf replacement in libcompat to be compiled,
even on systems that provide a C99 compliant replacement.

This will be useful for vetting the replacement, as a system
without a C99 snprintf may not be readily available.

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

11 years agoSilence warning about missing exit() prototype
brarcher [Sun, 6 Oct 2013 21:17:39 +0000 (21:17 +0000)]
Silence warning about missing exit() prototype

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

11 years agoPrevent setting a timeout with fork unavailable
brarcher [Sun, 6 Oct 2013 21:17:37 +0000 (21:17 +0000)]
Prevent setting a timeout with fork unavailable

If fork() is unavailable, then setting a timeout is meaningless,
as tests are unable to be cut off if they overrun their time.

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

11 years agoDo not compile set env functions without a working setenv
brarcher [Sun, 6 Oct 2013 21:17:35 +0000 (21:17 +0000)]
Do not compile set env functions without a working setenv

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

11 years agoSilence warning about no new line at end of file
brarcher [Sun, 6 Oct 2013 21:17:33 +0000 (21:17 +0000)]
Silence warning about no new line at end of file

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

11 years agoDo not compile unused tests
brarcher [Fri, 4 Oct 2013 01:38:19 +0000 (01:38 +0000)]
Do not compile unused tests

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

11 years agosilence warning about wrong type passed to localtime_r
brarcher [Fri, 4 Oct 2013 01:38:17 +0000 (01:38 +0000)]
silence warning about wrong type passed to localtime_r

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

11 years agosilence warning about invalid prototype
brarcher [Fri, 4 Oct 2013 01:38:15 +0000 (01:38 +0000)]
silence warning about invalid prototype

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

11 years agosilence warnings about unused parameters if fork is unavailable
brarcher [Fri, 4 Oct 2013 01:38:12 +0000 (01:38 +0000)]
silence warnings about unused parameters if fork is unavailable

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

11 years agosilence warning about ck_do_nothing being able to return
brarcher [Fri, 4 Oct 2013 01:38:08 +0000 (01:38 +0000)]
silence warning about ck_do_nothing being able to return

The prototype for ck_do_nothing marks it as noreturn.
gcc thought that the function could still return. Adding
an exit() call at the end (although the assert() will not
let it get that far) to silence the warning.

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

11 years ago* allow silent rules (don't show compiler flags)
cpickett [Thu, 3 Oct 2013 17:13:33 +0000 (17:13 +0000)]
* allow silent rules (don't show compiler flags)

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

11 years agoChange %p to %#x for printing pointers
brarcher [Thu, 3 Oct 2013 02:40:17 +0000 (02:40 +0000)]
Change %p to %#x for printing pointers

The MinGW platform prints %p as a 0 extended %d. As %#x is
equivalent to %p, replacing it in hopes that MinGW will print
what is expected.

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

11 years agoDon't declare localtime_r when it's a macro
brarcher [Thu, 3 Oct 2013 02:01:50 +0000 (02:01 +0000)]
Don't declare localtime_r when it's a macro

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

11 years agoRemove -Werror from automake
brarcher [Thu, 3 Oct 2013 02:01:48 +0000 (02:01 +0000)]
Remove -Werror from automake

On newer versions of automake, doc/Makefile.am causes a warning:

It appears this file (or files included by it) are triggering
an undocumented, soon-to-be-removed automake hack.
Future automake versions will no longer place in the builddir
(rather than in the srcdir) the generated '.info' files that
appear to be cleaned, by e.g. being listed in CLEANFILES or
DISTCLEANFILES. If you want your '.info' files to be placed in the
builddir rather than in the srcdir, you have to use the
shiny new 'info-in-builddir' automake option.

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

11 years agoUpdate NEWS with MinGW support.
brarcher [Wed, 2 Oct 2013 02:56:09 +0000 (02:56 +0000)]
Update NEWS with MinGW support.

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

11 years agoDefine 'struct timespec' if unavailable in time.h
brarcher [Wed, 2 Oct 2013 02:55:02 +0000 (02:55 +0000)]
Define 'struct timespec' if unavailable in time.h

MinGW does not provide a definition for 'struct timespec' in time.h
Providing a definition in libcompat.h if detected.

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

11 years agoClarify NEWS about MinGW-w64 support - no fork used
brarcher [Tue, 1 Oct 2013 22:21:11 +0000 (22:21 +0000)]
Clarify NEWS about MinGW-w64 support - no fork used

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

11 years agoUpdate NEWS with information on Cygwin support for Windows
brarcher [Tue, 1 Oct 2013 22:21:09 +0000 (22:21 +0000)]
Update NEWS with information on Cygwin support for Windows

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

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