Andreas Schneider [Mon, 15 Sep 2014 07:47:53 +0000 (09:47 +0200)]
doc: Update cmocka documentation for new test runner.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Sun, 14 Sep 2014 18:05:06 +0000 (20:05 +0200)]
cmocka: Mark run_tests as deprecated.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Jakub Hrozek [Wed, 4 Feb 2015 16:48:42 +0000 (17:48 +0100)]
cmocka: Add new message printing formatter for testcases
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Jakub Hrozek [Sat, 7 Feb 2015 14:18:25 +0000 (15:18 +0100)]
tests: Add a test for failing group setup
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Andreas Schneider [Fri, 12 Sep 2014 15:18:57 +0000 (17:18 +0200)]
tests: Use new cmocka test runner in our tests and examples
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 5 Feb 2015 09:45:30 +0000 (10:45 +0100)]
cmocka: Add support to print errors into a buffer.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Mon, 20 Oct 2014 08:17:03 +0000 (10:17 +0200)]
cmocka: Add correct checks for clock_gettime().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Fri, 5 Sep 2014 15:02:04 +0000 (17:02 +0200)]
cmocka: Implement a new test runner.
Pair-Programmed-With: Jakub Hrozek <jakub.hrozek@posteo.se>
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Andreas Schneider [Fri, 6 Feb 2015 10:50:41 +0000 (11:50 +0100)]
tests: Add tests for test_malloc() and test_realloc().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Jakub Hrozek [Sat, 7 Feb 2015 15:27:31 +0000 (16:27 +0100)]
cmocka: Add explicit libc_alloc, realloc, free
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Andreas Schneider [Fri, 6 Feb 2015 10:50:05 +0000 (11:50 +0100)]
cmocka: Add a test_realloc() function.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Fri, 6 Feb 2015 10:51:22 +0000 (11:51 +0100)]
cmocka: Allow test_free() to deal with NULL pointers.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 11 Sep 2014 15:19:27 +0000 (17:19 +0200)]
cmocka: Make global variables thread local.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 11 Sep 2014 15:07:50 +0000 (17:07 +0200)]
cmake: Add configure checks for thread local storage.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 11 Sep 2014 15:10:56 +0000 (17:10 +0200)]
config: Remove unused options.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Sun, 14 Sep 2014 18:09:27 +0000 (20:09 +0200)]
cmocka: Use ARRAY_SIZE everywhere.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Mon, 20 Oct 2014 08:13:27 +0000 (10:13 +0200)]
config: Fix define for strsignal().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 30 Sep 2014 14:32:46 +0000 (16:32 +0200)]
cmocka: Fix setting size_of_set in expect_set().
BUG: https://open.cryptomilk.org/issues/34
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Jakub Hrozek [Tue, 29 Jul 2014 08:22:31 +0000 (10:22 +0200)]
GNU_SOURCE is not a compiler flag
This line in DefineCompilerFlags.cmake always passed:
check_c_compiler_flag("-D_GNU_SOURCE" WITH_GNU_SOURCE)
because -D$string just defined a preprocessor macro, so the compilation
would always succeed.
On UNIX platforms, with GCC or LLVM compilers, we want to always use
GNU_SOURCE.
Andreas Schneider [Thu, 7 Aug 2014 11:29:33 +0000 (13:29 +0200)]
cmake: Use standard cmake variables in CMakeLists.txt.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Emil Velikov [Fri, 25 Jul 2014 13:31:24 +0000 (14:31 +0100)]
cmocka: do not use # with the %p printf modifier
Missed out during while amending commit
61b2b557951(cmocka: use %p to
printf a pointer).
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Emil Velikov [Fri, 25 Jul 2014 13:31:23 +0000 (14:31 +0100)]
cmocka: use ISO C99 PRIu64 over LargestIntegralTypePrintfUnsignedFormat
With commit commit
8642ef21b07(cmocka: introduce
LargestIntegralTypePrintfUnsignedFormat modifier) we introduces this
superfluous macro in order to work around the differences when printing
64bit unsigned integer values.
Rather than reinventing the wheel use the C99's PRIu64 and fall back
locally to their platform/compiler specific counterparts if the
inttypes.h header does not exist.
Thanks to scythe from the #cmocka channel for pointing out.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Emil Velikov [Sat, 19 Jul 2014 17:51:18 +0000 (18:51 +0100)]
cmocka: introduce LargestIntegralTypePrintfUnsignedFormat modifier
The modifier is almost identical to LargestIntegralTypePrintfFormat
in terms that it handles 64bit integer values, but unlike the latter
it prints them as unsigned value.
Behind the scenes it uses %I64u for windows, and %llu otherwise.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Emil Velikov [Sat, 19 Jul 2014 17:51:19 +0000 (18:51 +0100)]
cmocka: use %p to printf a pointer
Allegedly some versions of MSVC do not prefix the address with 0x
whenever %p is used, while gcc (mingw-w64) always do. There is no
clear way around this without providing a custom define, which
currently is an overkill imho, as there is only one use-case.
Silences the following warning when building with mingw-w64
cmocka/src/cmocka.c:1636:25: warning: format ‘%x’ expects argument of
type ‘unsigned int’, but argument 3 has type ‘PVOID’ [-Wformat=]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Michael Adam [Thu, 29 May 2014 14:00:11 +0000 (16:00 +0200)]
cmocka: fix doxygen comment for assert_not_in_range()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Michael Adam [Thu, 29 May 2014 13:57:37 +0000 (15:57 +0200)]
cmocka: fix doxygen comment for assert_in_range()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Michael Adam [Thu, 29 May 2014 13:55:11 +0000 (15:55 +0200)]
cmocka: fix doxygen comment for assert_return_code()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 22 May 2014 12:40:35 +0000 (14:40 +0200)]
Bump version to 0.4.1.
Andreas Schneider [Thu, 22 May 2014 12:34:11 +0000 (14:34 +0200)]
cmake: Fix cmocka cmake-config files.
Andreas Schneider [Tue, 20 May 2014 09:03:39 +0000 (11:03 +0200)]
doc: Improve documentation for fail_msg().
BUG: https://open.cryptomilk.org/issues/29
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 16 Apr 2014 13:46:10 +0000 (15:46 +0200)]
cmake: Install cmake config to the correct directory.
Andreas Schneider [Tue, 15 Apr 2014 15:21:30 +0000 (17:21 +0200)]
cmocka: Fix type of number_of_test_states which can be negative.
Sebastian Dröge [Tue, 15 Apr 2014 12:38:07 +0000 (14:38 +0200)]
Correctly report the number of tests without the number of setup/teardown functions included
Reviewed-by: Andreas Schneider <asn@samba.org>
Andreas Schneider [Tue, 15 Apr 2014 14:58:25 +0000 (16:58 +0200)]
cmocka: Add CMOCKA_TEST_ABORT env variable to leave threading apps.
BUG: https://open.cryptomilk.org/issues/26
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Andreas Schneider [Tue, 15 Apr 2014 14:49:07 +0000 (16:49 +0200)]
coverity: Add _assert_return_code model.
Andreas Schneider [Mon, 14 Apr 2014 07:23:23 +0000 (09:23 +0200)]
cmake: Ignore .ycm_extra_conf.pyc.
Andreas Schneider [Fri, 11 Apr 2014 14:49:27 +0000 (16:49 +0200)]
doc: Document the group functions.
Sebastian Dröge [Fri, 7 Feb 2014 16:51:21 +0000 (17:51 +0100)]
include: Fix count parameter of expect_check() macro
It was always using 0, which meant that the values were never
ever used. This commit changes it to 1, which is consistent with
the other macros.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Fri, 11 Apr 2014 13:22:07 +0000 (15:22 +0200)]
Bump version to 0.4.0.
Andreas Schneider [Fri, 11 Apr 2014 13:43:12 +0000 (15:43 +0200)]
cmocka: Define inline if not defined with MSVC.
Andreas Schneider [Fri, 11 Apr 2014 12:44:48 +0000 (14:44 +0200)]
Add YouCompleteMe config.
You should use 'obj' as your build directory.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Andreas Schneider [Mon, 23 Dec 2013 18:06:11 +0000 (19:06 +0100)]
tests: Add test_group_fixtures.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Andreas Schneider [Mon, 23 Dec 2013 18:05:14 +0000 (19:05 +0100)]
cmocka: Add support for test groups.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Andreas Schneider [Thu, 10 Apr 2014 09:28:22 +0000 (11:28 +0200)]
cmake: Update UseDoxygen.cmake.
Andreas Schneider [Thu, 10 Apr 2014 09:23:17 +0000 (11:23 +0200)]
tests: Improve the fixture test.
This way we make sure we don't run into an assert if we have more
teardown functions than setup functions.
Andreas Schneider [Thu, 10 Apr 2014 09:22:16 +0000 (11:22 +0200)]
cmocka: Add a dummy function for setup and teardown.
We need a matching number for setup and teardown functions else we can
run in an assert. So this adds a dummy which doesn't do anything.
Andreas Schneider [Wed, 9 Apr 2014 08:10:57 +0000 (10:10 +0200)]
cmake: Create the compile command database by default.
Andreas Schneider [Wed, 9 Apr 2014 08:10:48 +0000 (10:10 +0200)]
doc: Fix some typos.
Lukas Slebodnik [Wed, 26 Feb 2014 12:45:02 +0000 (13:45 +0100)]
Test should not be run if setup function fails
Assertions are commonly used in setup function. If setup function fail
test should not be executed, because it may result into unexpected behaviour
(crash)
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Lukas Slebodnik [Wed, 26 Feb 2014 12:46:18 +0000 (13:46 +0100)]
basic_test should be run with other CMOCKA_TESTS
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Lukas Slebodnik [Fri, 21 Feb 2014 10:45:27 +0000 (11:45 +0100)]
Use prefix for commonly used macro PRINTF_ATTRIBUTE
It may cause warning:
/usr/include/cmocka.h:50:0: warning: "PRINTF_ATTRIBUTE" redefined
[enabled by default]
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Lukas Slebodnik [Fri, 21 Feb 2014 10:58:03 +0000 (11:58 +0100)]
Enable warning Wundef
It is better to use "#ifdef" for testing macros instead of "#if"
In header file, "#ifdef DOXYGEN" was used 30 times and "#if DOXYGEN"
23 times. This patch makes it consistent and enable warning Wundef to prevent
this kind of issues.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Lukas Slebodnik [Fri, 21 Feb 2014 12:37:46 +0000 (13:37 +0100)]
Use static modifier for temporary_buffer
temporary_buffer is used only in the module calculator_test.c
It's better to use use static modifier explicitly in this case.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Lukas Slebodnik [Fri, 21 Feb 2014 10:22:50 +0000 (11:22 +0100)]
Use better formatting string for printing numbers
Numbers were printed as hexadecimal.n eror message,
It is good practice to print "0x" before hexadecimal numbers,
because it may be confusing without this.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 22 Jan 2014 14:50:40 +0000 (15:50 +0100)]
cmake: Do not build the chef_wrap example on OSX.
Andreas Schneider [Mon, 20 Jan 2014 22:39:19 +0000 (23:39 +0100)]
cmake: Add cmake config mode support.
Andreas Schneider [Tue, 24 Dec 2013 08:26:42 +0000 (09:26 +0100)]
tests: Close the fd in test_assert_macros_fail.
This is not really necessary but it fixes Coverity.
CID #1146810
Andreas Schneider [Mon, 23 Dec 2013 18:58:34 +0000 (19:58 +0100)]
Revert "tests: Use internal allocation for test_fixtures."
This reverts commit
eb3613e6b4c7b1d6d3a6593bd20ce8654e6bc5b8.
Andreas Schneider [Mon, 23 Dec 2013 15:16:01 +0000 (16:16 +0100)]
cmocka: Fix typo in the docs.
Andreas Schneider [Mon, 23 Dec 2013 15:13:51 +0000 (16:13 +0100)]
cmake: Run examples in 'make test' too.
Andreas Schneider [Mon, 23 Dec 2013 15:12:23 +0000 (16:12 +0100)]
tests: Add test_basics.
Andreas Schneider [Mon, 23 Dec 2013 18:06:07 +0000 (19:06 +0100)]
tests: Use internal allocation for test_fixtures.
Andreas Schneider [Mon, 23 Dec 2013 15:07:46 +0000 (16:07 +0100)]
tests: Add test_fixtures.
Andreas Schneider [Mon, 23 Dec 2013 15:06:04 +0000 (16:06 +0100)]
tests: Add test_exception_handler_fail.
Andreas Schneider [Mon, 23 Dec 2013 15:03:50 +0000 (16:03 +0100)]
tests: Add test_assert_macros_fail.
Andreas Schneider [Mon, 23 Dec 2013 15:00:07 +0000 (16:00 +0100)]
tests: Add test_assert_macros.
Andreas Schneider [Mon, 23 Dec 2013 14:38:00 +0000 (15:38 +0100)]
cmocka: Add assert_return_code().
Andreas Schneider [Sat, 21 Dec 2013 16:22:35 +0000 (17:22 +0100)]
example: Define UNIT_TESTING in run_tests.c.
This makes sure we ue the unit test allocators.
Andreas Schneider [Sat, 21 Dec 2013 16:19:22 +0000 (17:19 +0100)]
cmake: Fix calling the assert_module test.
Andreas Schneider [Thu, 19 Dec 2013 17:00:17 +0000 (18:00 +0100)]
doc: Improve the API mainpage.
Andreas Schneider [Fri, 13 Dec 2013 09:54:53 +0000 (10:54 +0100)]
example: Add the most simple test with cmocka.
Andreas Schneider [Fri, 13 Dec 2013 09:51:04 +0000 (10:51 +0100)]
example: Fix exception handler test on Solaris.
Andreas Schneider [Fri, 13 Dec 2013 09:55:11 +0000 (10:55 +0100)]
Add obj directory for config.h to .clang_complete.
Andreas Schneider [Wed, 11 Dec 2013 17:52:12 +0000 (18:52 +0100)]
example: Add an exampele to test exception handling.
Andreas Schneider [Wed, 11 Dec 2013 17:51:25 +0000 (18:51 +0100)]
cmocka: Print better message for exceptions.
Andreas Schneider [Wed, 11 Dec 2013 17:51:04 +0000 (18:51 +0100)]
config: Add missing define for strsignal().
Andreas Schneider [Thu, 28 Nov 2013 13:10:03 +0000 (14:10 +0100)]
cmake: Fix compilation with -D_FORTIFY_SOURCE.
Andreas Schneider [Wed, 6 Nov 2013 08:25:38 +0000 (09:25 +0100)]
Add obj directory to .gitignore.
Andreas Schneider [Wed, 6 Nov 2013 07:13:01 +0000 (08:13 +0100)]
cmake: Exclude obj directory.
Andreas Schneider [Wed, 6 Nov 2013 06:54:45 +0000 (07:54 +0100)]
Update ChangeLog.
Travis Hendrickson [Sun, 27 Oct 2013 14:58:29 +0000 (15:58 +0100)]
include: Don't stringify twice with will_return_always().
Andreas Schneider [Sun, 27 Oct 2013 14:54:53 +0000 (15:54 +0100)]
include: Fix unit_test_teardown macro.
Aleksandr Vinokurov [Wed, 21 Aug 2013 14:38:39 +0000 (18:38 +0400)]
Fix GTest and GCC message style conformance
Move file:line ids to the beginning of the strings, adding 'note' levels as in GCC style
Andreas Schneider [Sun, 11 Aug 2013 10:12:05 +0000 (12:12 +0200)]
doc: Update the main doc page.
Andreas Schneider [Sun, 11 Aug 2013 10:11:50 +0000 (12:11 +0200)]
cmake: Disable broken latex doc generation.
Andreas Schneider [Mon, 29 Jul 2013 17:35:34 +0000 (19:35 +0200)]
include: Correctly define unit_test_setup() and unit_test_teardown().
Thanks to James Grenning <james@grenning.net>.
Andreas Schneider [Mon, 29 Jul 2013 17:39:46 +0000 (19:39 +0200)]
coverity: Add modeling file for assert functions.
Andreas Schneider [Thu, 25 Jul 2013 21:03:02 +0000 (23:03 +0200)]
README: Fix a typo and improve cmocka cmldine.
Thanks to James Grenning <james@grenning.net>.
Andreas Schneider [Wed, 24 Jul 2013 09:15:25 +0000 (11:15 +0200)]
cmake: Fix description and display name.
Andreas Schneider [Wed, 24 Jul 2013 09:13:07 +0000 (11:13 +0200)]
cmake: Fix a typo in FindNSIS.
Andreas Schneider [Wed, 24 Jul 2013 09:09:11 +0000 (11:09 +0200)]
cmake: Update FindNSIS module.
Andreas Schneider [Wed, 24 Jul 2013 08:43:11 +0000 (10:43 +0200)]
cmake: Fix homepage url.
Andreas Schneider [Wed, 24 Jul 2013 08:21:56 +0000 (10:21 +0200)]
cmake: Bump version number and so version.
Andreas Schneider [Wed, 24 Jul 2013 08:08:44 +0000 (10:08 +0200)]
example: Add missing stdlib.h.
This fixes a build error on Windows.
Andreas Schneider [Wed, 24 Jul 2013 08:03:31 +0000 (10:03 +0200)]
Add .gitignore.
Andreas Schneider [Wed, 24 Jul 2013 08:00:19 +0000 (10:00 +0200)]
include: Don't redefine uintptr_t on Windows.
Visual Studio defines _UINTPTR_T_DEFINED if we have uintptr_t.
Andreas Schneider [Wed, 24 Jul 2013 06:19:25 +0000 (08:19 +0200)]
cmake: Set nightly start time to UTC.
Pavel Březina [Thu, 18 Jul 2013 11:19:08 +0000 (13:19 +0200)]
Add new macro will_return_always
Signed-off-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Pavel Březina [Wed, 17 Jul 2013 09:07:39 +0000 (11:07 +0200)]
Add new macro fail_msg
Signed-off-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Fri, 12 Jul 2013 10:23:18 +0000 (12:23 +0200)]
cov: Add coverity modeling file.