Krzysztof Opasiak [Mon, 3 Jul 2017 11:13:03 +0000 (13:13 +0200)]
packaging: Add packaging for generating RPM package
Change-Id: I0f6792555797b758c2bdca16fb424b2ae83a613c
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Andreas Schneider [Thu, 22 Jun 2017 07:29:57 +0000 (09:29 +0200)]
src: Initialize teardown_name to fix a build warning
BUG #60
Andreas Schneider [Fri, 7 Apr 2017 14:16:13 +0000 (16:16 +0200)]
Bump version to 1.1.1
Andreas Schneider [Fri, 7 Apr 2017 14:09:48 +0000 (16:09 +0200)]
cmocka: Change define to HAVE_CLOCK_REALTIME
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 5 Apr 2017 08:16:15 +0000 (10:16 +0200)]
src: Do not use C++ keywords as local variables
Stas Kobzar [Tue, 4 Apr 2017 15:06:15 +0000 (11:06 -0400)]
Fix TAP output and summary.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 7 Mar 2017 12:36:25 +0000 (13:36 +0100)]
Update doxygen config
Martin Fischer [Sat, 21 Jan 2017 08:55:14 +0000 (09:55 +0100)]
doxygen: Allow space in path names
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Terje Runde [Sat, 3 Dec 2016 19:14:18 +0000 (20:14 +0100)]
Remove dangling unit test source file.
Andreas Schneider [Sat, 12 Nov 2016 11:13:13 +0000 (12:13 +0100)]
cmake: Add -Wstrict-prototypes during build
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Adrian Friedli [Tue, 25 Oct 2016 08:57:21 +0000 (10:57 +0200)]
src: Add support for compile flag -Wstrict-prototypes
Andreas Schneider [Mon, 7 Nov 2016 07:03:10 +0000 (08:03 +0100)]
cmocka: Leave if expected_call is NULL
CID 1365415
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Adrien Marc [Tue, 4 Oct 2016 16:18:42 +0000 (18:18 +0200)]
Fixed xUnit output durations
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Nikos Mavrogiannopoulos [Thu, 29 Sep 2016 08:14:53 +0000 (10:14 +0200)]
This patch allows cmocka to be run under windows 64-bit
In that system while the maximum word size is 64-bits, the
'unsigned long int' type is only 32-bits.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 21 Sep 2016 14:30:39 +0000 (16:30 +0200)]
cpack: Ignore all object directories
Andreas Schneider [Wed, 21 Sep 2016 13:54:41 +0000 (15:54 +0200)]
Bump version to 1.1.0
David Schneider [Wed, 21 Sep 2016 13:20:09 +0000 (15:20 +0200)]
tests: Add test_groups test to validate xml output
This is for multiple groups in one test to make sure they do not create
invalid xml.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 21 Sep 2016 12:22:52 +0000 (14:22 +0200)]
cmocka: Do not add xml headers twice
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 21 Sep 2016 12:21:33 +0000 (14:21 +0200)]
cmocka: Add file pattern to create xml file for each group
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Joseph Ates [Sun, 20 Dec 2015 21:29:09 +0000 (16:29 -0500)]
Fixed format specifier width mismatch
On some platforms PRIu64 is not necessarily the width of the
LargestIntegralType. A new decimal format specifier for
LargestIntegralType was added and replaces the invocations of PRIu64.
Andreas Schneider [Wed, 21 Sep 2016 09:21:28 +0000 (11:21 +0200)]
cmocka: Use defines for WILL_RETURN values
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Aris Adamantiadis [Wed, 1 Jun 2016 18:50:38 +0000 (20:50 +0200)]
vcm_print_error: fix segfault on long messages
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 3 Mar 2016 08:12:21 +0000 (09:12 +0100)]
cmake: Fix possible issues with librt during configure
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Joseph Ates [Sat, 23 Jan 2016 11:53:29 +0000 (06:53 -0500)]
cmake: Add MinGW DLL Prefix Workaround
CMake assigns "lib" as the prefix to shared libraries on MinGW
GCC, but MinGW does not expect such a prefix when linking to
DLLs. By setting, CMAKE_SHARED_LIBRARY_PREFIX to "" the
example tests were able to run with the exception of the
calculator_test which segfaults (SIGSEGV) on the setjmp in
test_divide_by_zero. This fault is specific to MinGW and does not
occur within runs on Cygwin or Visual Studio.
calculator_test was enabled only for static linking on MinGW
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Joseph Ates [Sat, 23 Jan 2016 10:14:04 +0000 (05:14 -0500)]
cmocka: Add VS2015 support
Visual Studio now includes support for vsnprintf and snprintf but does
so as an inline functions. check_symbol_exists is used to check for
its existence within stdio. [3] All tests are passing when run from
within the IDE or via NMake. Command line builds via msbuild seem to
error for the first few example tests.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Joseph Ates [Wed, 10 Feb 2016 11:16:13 +0000 (12:16 +0100)]
cmocka: Add will_return_maybe() for ignoring mock returns
As both parameter and function call order checking allow for ignoring
cases where they are never invoked, the mock return values are at
somewhat of a mismatch in that they must always be returned at least
once (even in the case of will_return_always()). Therefore, the ability
to set the count to -2 on will_return_count was added with a new macro
(will_return_maybe) that indicates that that the value field may never
be returned and still allow a successful test.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Joseph Ates [Wed, 10 Feb 2016 11:16:17 +0000 (12:16 +0100)]
cmocka: Fix indentation
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Emil Velikov [Mon, 4 Jan 2016 14:25:22 +0000 (16:25 +0200)]
cmocka: Include strings.h for strcasecmp
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 10 Feb 2016 11:00:36 +0000 (12:00 +0100)]
tests: Add a group setup assert test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 10 Feb 2016 10:57:11 +0000 (11:57 +0100)]
cmocka: Print group setup and teardown errors
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Joseph Ates [Thu, 12 Nov 2015 18:09:36 +0000 (13:09 -0500)]
tests: Add test for call ordering functionality
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Joseph Ates [Thu, 12 Nov 2015 18:08:15 +0000 (13:08 -0500)]
cmocka: Add support to verify call ordering
Andreas Schneider [Wed, 28 Oct 2015 08:27:10 +0000 (09:27 +0100)]
Ignore all build and obj* directores
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Mon, 19 Oct 2015 16:15:05 +0000 (18:15 +0200)]
INSTALL: Add Testing section
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 7 Oct 2015 14:42:32 +0000 (16:42 +0200)]
INSTALL: Add example for Windows
Looks like it isn't clear for some people reading that file that we
support Windows and MSVC ...
Andreas Schneider [Mon, 5 Oct 2015 07:23:35 +0000 (09:23 +0200)]
src: Fix some compiler warnings
BUG: https://open.cryptomilk.org/issues/43
Andreas Schneider [Wed, 30 Sep 2015 11:07:08 +0000 (13:07 +0200)]
src: Use variable name for accessing the array elements
Andreas Schneider [Wed, 30 Sep 2015 10:43:06 +0000 (12:43 +0200)]
include: Improve documentation for prestate macros
Pawel Szewczyk [Mon, 14 Sep 2015 10:52:12 +0000 (12:52 +0200)]
cmocka: Allow to pass initial data to test cases
Sometimes multiple test cases share the same test function, running it
on different data. To pass this data to test functions we must define
setup function for each data set. It's not very convienient when there
are many states to test.
This commit introduce more elegant way to pass data to tests. The
initial_state field of CMUnitTest structure can be defined by user.
It will be either passed to setup function, which makes any preparation
needed, or it will be passed directly to test function when setup func is
NULL.
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Andreas Schneider [Mon, 14 Sep 2015 16:24:41 +0000 (18:24 +0200)]
src: Simplify exception_handler()
Jonathon Reinhart [Tue, 8 Sep 2015 23:18:48 +0000 (19:18 -0400)]
test: update test_segfault_recovery to try multiple faults
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Jonathon Reinhart [Tue, 8 Sep 2015 03:26:20 +0000 (23:26 -0400)]
Use sigsetjmp()/siglongjmp() when available
Without using siglongjmp, the signal mask is not restored when
longjmp-ing from the signal handler, and whichever signal was
being handled remains blocked for the remainder of the tests. As a
result, the same signal cannot be caught twice, and will cause process
termination when being raised the second time.
This does not change 'jmp_buf global_expect_assert_env', because it is
part of the public API, and isn't used from a signal handler.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 9 Sep 2015 08:16:51 +0000 (10:16 +0200)]
src: Improve error reporting with cmocka default output
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Andreas Schneider [Mon, 7 Sep 2015 07:40:46 +0000 (09:40 +0200)]
src: Filter out invalid tests.
Andreas Schneider [Tue, 4 Aug 2015 17:32:28 +0000 (19:32 +0200)]
include: Protect config.h inclusion
Thanks to Gregory Pakosz.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Sat, 1 Aug 2015 13:55:03 +0000 (15:55 +0200)]
include: Add va_copy macro if MSVC doesn't provide it
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 7 Jul 2015 09:07:01 +0000 (11:07 +0200)]
cmake: Fix warning on OSX
Andreas Schneider [Tue, 7 Jul 2015 09:06:45 +0000 (11:06 +0200)]
def: Add missing cmocka_set_message_output symbol
Pawel Szewczyk [Mon, 11 May 2015 11:34:29 +0000 (13:34 +0200)]
cmocka: Print skipped tests in group summary
When running tests with standard output, information about skipped
tests can be useful, especially when there are many tests. This commit
add number of skipped tests and list of them to group summary.
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Mon, 11 May 2015 11:28:43 +0000 (13:28 +0200)]
gitignor: Ignore all object file directories
Ellie Timoney [Mon, 11 May 2015 11:26:23 +0000 (13:26 +0200)]
cmocka: Add subtests for groups using TAP output
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 12 Mar 2015 11:56:06 +0000 (12:56 +0100)]
Bump version to 1.0.1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 12 Mar 2015 11:55:49 +0000 (12:55 +0100)]
Update ChangeLog.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Niels de Vos [Thu, 26 Feb 2015 20:47:03 +0000 (21:47 +0100)]
cmocka: realloc(ptr, 0) should act as free(ptr)
Currently, realloc(ptr, 0) does not free the pointer as specified by
'man 3 realloc':
The realloc() function changes the size of the memory block pointed
to by ptr to size bytes. [...] if size is equal to zero, and ptr is
not NULL, then the call is equivalent to free(ptr). [...]
This causes a leak of the allocated memory, and tests that use this
particular realloc() pattern fail.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Jakub Hrozek [Wed, 25 Feb 2015 08:09:35 +0000 (09:09 +0100)]
Fix function types in doxygen docs
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Fri, 20 Feb 2015 14:06:18 +0000 (15:06 +0100)]
cmake: Use https to drop results.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Fri, 20 Feb 2015 08:48:36 +0000 (09:48 +0100)]
include: Add macro for assert_ptr_equal().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Fri, 20 Feb 2015 08:47:44 +0000 (09:47 +0100)]
include: Fix building with newer gcc versions.
__func__ is not a macro. We just need to define it on Windows for now.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Mon, 16 Feb 2015 14:22:38 +0000 (15:22 +0100)]
cpack: Exclude object directories.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Sun, 8 Feb 2015 12:49:51 +0000 (13:49 +0100)]
Bump version to 1.0.0.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Sat, 7 Feb 2015 17:07:32 +0000 (18:07 +0100)]
Update ChangeLog.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Fri, 13 Feb 2015 12:36:52 +0000 (13:36 +0100)]
include: Use LargestIntegralType instead of uintmax_t
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Fri, 13 Feb 2015 12:08:17 +0000 (13:08 +0100)]
include: Fix documentation for mock functions
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 12 Feb 2015 18:44:39 +0000 (19:44 +0100)]
cmake: Disable some tests on Windows.
They work when executed manually but not with ctest.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 12 Feb 2015 18:17:46 +0000 (19:17 +0100)]
examples: Use WILL_FAIL instead of regular expression
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 12 Feb 2015 17:34:17 +0000 (18:34 +0100)]
cmake: Fix running examples on Windows.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Jakub Hrozek [Thu, 12 Feb 2015 17:05:16 +0000 (18:05 +0100)]
tests: Use a different regex for segfault on Windows
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Krzysztof Opasiak [Thu, 12 Feb 2015 13:11:41 +0000 (14:11 +0100)]
cmocka: examples: Fix assert macros usage
Replace used macros with more suitable
for given context.
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Krzysztof Opasiak [Thu, 12 Feb 2015 13:11:37 +0000 (14:11 +0100)]
cmocka: Surround include info with code endcode
Doxygen makes list of includes hard to read when
it is not explicitly marked as code. Surround it
with code marks to improve readability.
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Jakub Hrozek [Thu, 12 Feb 2015 16:10:21 +0000 (17:10 +0100)]
cmocka: Include cmocka_private.h after cmocka.h
cmocka_private.h uses WORDSIZE:
# if __WORDSIZE == 64
# define __PRI64_PREFIX "l"
But on some platforms, like Solaris, cmocka guesses its own WORDSIZE
value in cmocka.h. Therefore it's important to include cmocka_private.h
after cmocka.h
Andreas Schneider [Thu, 12 Feb 2015 16:05:39 +0000 (17:05 +0100)]
cmake: Always set correct output name.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 12 Feb 2015 16:00:34 +0000 (17:00 +0100)]
include: Correctly include signal.h
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 12 Feb 2015 08:14:10 +0000 (09:14 +0100)]
cmake: Fix executing test examples on Windows.
The executable need the path to dll set so they can be run successfully.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 12 Feb 2015 08:03:16 +0000 (09:03 +0100)]
cmake: Build tests with the static library.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Thu, 12 Feb 2015 08:00:17 +0000 (09:00 +0100)]
include: Fix warning for missing __WORDSIZE
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 17:13:55 +0000 (18:13 +0100)]
tests: Add io.h for open() and close() on Windows.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 17:09:55 +0000 (18:09 +0100)]
cmake: Do not set gcc flags in VC.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 17:00:11 +0000 (18:00 +0100)]
tests: Fix test_assert_macros* with Visual Studio.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 16:57:28 +0000 (17:57 +0100)]
tests: Fix building the tests with Visual Studio.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 16:44:37 +0000 (17:44 +0100)]
config: Add missing define for (v)snprintf functions.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 16:36:10 +0000 (17:36 +0100)]
cmake: Fix a typo in the options
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 10:20:08 +0000 (11:20 +0100)]
cmocka: Cast correctly to errno type
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 10:19:40 +0000 (11:19 +0100)]
include: Add missing functions for Visual Studio.
Move the ugly stuff to cmocka_private.h.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 10:19:10 +0000 (11:19 +0100)]
def: Export missing symbols on Windows.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 07:21:43 +0000 (08:21 +0100)]
cmocka: Fix possible test state issues
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 07:10:07 +0000 (08:10 +0100)]
include: Define __WORDSIZE if needed.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Wed, 11 Feb 2015 06:55:47 +0000 (07:55 +0100)]
include: Fix pointer casting and add check_expected_ptr()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 10 Feb 2015 14:36:13 +0000 (15:36 +0100)]
cmocka: Fix a double free in cmprintf_tap()
CID: #1268622
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 10 Feb 2015 14:34:23 +0000 (15:34 +0100)]
cmocka: Initialize group_state in _cmocka_run_group_tests()
CID: #1268623
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 10 Feb 2015 14:05:37 +0000 (15:05 +0100)]
cmake: Turn off deprecated warning for test_cmockery.c
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 10 Feb 2015 09:59:15 +0000 (10:59 +0100)]
include: Define fix defintion of LargestIntegralType
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 10 Feb 2015 09:53:32 +0000 (10:53 +0100)]
cmocka: Fix printf integer formats.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 10 Feb 2015 07:11:30 +0000 (08:11 +0100)]
cmocka: Add printf attribute checking for vcm_print_error()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Mon, 9 Feb 2015 12:39:57 +0000 (13:39 +0100)]
cmocka: Check if 'struct timespec' is available.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Mon, 9 Feb 2015 13:42:34 +0000 (14:42 +0100)]
cmocka: Only handle SIGBUS and SIGSYS if the system supports it.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Andreas Schneider [Tue, 10 Feb 2015 07:07:16 +0000 (08:07 +0100)]
cmocka: Fix length calculation.
CID: #1268624
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
SQ
Andreas Schneider [Tue, 10 Feb 2015 07:23:25 +0000 (08:23 +0100)]
cmocka: Allow include of cmocka_platform.h
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Jakub Hrozek [Mon, 9 Feb 2015 22:44:59 +0000 (23:44 +0100)]
tests: Add message output format tests
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Jakub Hrozek [Tue, 10 Feb 2015 10:12:00 +0000 (11:12 +0100)]
cmocka: Add a newline to subunit error output
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Jakub Hrozek [Tue, 10 Feb 2015 12:03:03 +0000 (13:03 +0100)]
cmocka: Print test errors directly to make them included in the XML output
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>