Branden Archer [Mon, 18 Jun 2018 17:59:47 +0000 (13:59 -0400)]
Move CloudBees tests to Travis-CI
Earlier this year GitHub deprecated some encryption types from
accessing repos. This broke the FC17 executors on CloudBees.
Trying to update to using the FC25 executors found that not
all tools were installed. CloudBees determined it would take
too much time to install the missing tools on FC25 which were
on FC17 (for a FOSS project), and declined to do so. As a result,
Check's tests no longer run on CloudBees.
In response, the tests which ran on CloudBees are being moved
to Travis-CI. This includes the pre release check, building the
documentation, building with scan-build, and building with some
of the configure arguments.
Instead of exporting the defined name as a bare function, export a
struct that has a pointer to the function, but also its name, file and
line number where it is defined.
Store that information into a new `struct TTest`.
After this commit, START_TEST(<testname>) will create three definitions:
- <testname>_fn: The actual function;
- <testname>_ttest: A `struct TTest` with the information about it;
- <testname>: A pointer to <testname>_ttest.
Functions `tcase_add_test()` and friends are updated to take a `TTest *`
argument rather than a `TFun` and separate name. The runners are updated
to find that information inside the linked `tc->ttest`. The call to
`tcase_fn_start()` is moved from the defined functions to the runners
(both the "fork" and the "nofork" one) which call it just before
invoking the test function.
A nice side-effect is that END_TEST is now optional, though the empty
`#define` is kept for backwards compability.
v2: Initialize the struct TTest by position to be compatible with older
compilers that do not recognize named fields (e.g. VS 2010, VS 2012.)
Tested:
- `make check` still passes.
- Removing END_TEST from test cases still produces valid code that
builds and passes tests.
Branden Archer [Sun, 22 Oct 2017 16:35:49 +0000 (12:35 -0400)]
Add warning on floating point eq and ne assertions
The usefulness of the float/double/ldouble eq and ne macros is very limited. Comparing
the results of a floating point computation should be done with some tolerance, instead
of expecting an exact answer. There may be differences on different platforms, etc.
To this end, some warnings are added to the eq and ne functions, instead directing users
to use the _tol functions instead.
Chris Leishman [Sat, 26 Aug 2017 05:26:56 +0000 (22:26 -0700)]
Fix invalid prototype for tcase_name(void)
The existing prototype in check.h is `const char* tcase_name()`. This
causes issues on platforms that use strict prototype checking, e.g. the
latest clang compiler with -Wstrict-prototypes ('this function
declaration is not a prototype [-Werror,-Wstrict-prototypes]').
bel2125 [Fri, 25 Aug 2017 18:29:18 +0000 (20:29 +0200)]
Remove dependency to stdbool.h
While this header is standard in C99, it does not exist in C89/C90.
Microsoft Visual Studio added this header only in version 2013.
Still common common compilers Visual Studio 2010 and 2012 (and all earlier)
do not support it.
Here we do not really have a benefit as compared to just using 'int'
instead of 'bool', so this dependency can easily be avoided to support
Visual Studio 2010 (see also https://github.com/libcheck/check/issues/125).
This program should be similar to what someone else could
use from Check. Removing this header will help determine
if anything in check.h is undefined.
Branden Archer [Sat, 13 May 2017 01:43:37 +0000 (21:43 -0400)]
Update 'no messaging setup' message
It was found that if a ck_assert() or ck_abort() call was made when not running a test
with srunner_run() that the current process would attempt to report a test
failure to the process which started the test, of which none exists. As a result,
finding no pipe file setup, the process aborts. This is all due to an API usage
mistake, as ck_assert* and ck_abort() should not be called outside of a
test or setup/teardown function.
To make it more clear that if one hits this it is a API usage issue, changing the
failure message which is reported.
Branden Archer [Wed, 10 May 2017 02:29:19 +0000 (22:29 -0400)]
Bail on error if cannot create pipe file
There have been cases where a test will fail with "No messaging setup". This is believed to be
a permissions issue, where the test process is unable to create a file in the folder selected
for temporary files. To make this error more explicit, if creating a temporary file fails bail.
Nicholas Humfrey [Sun, 15 Jan 2017 23:19:03 +0000 (23:19 +0000)]
Fix for "invalid suffix on literal" error in clang
Invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]