Hello community, here is the log from the commit of package cmocka for openSUSE:Factory checked in at 2014-09-12 10:03:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cmocka (Old) and /work/SRC/openSUSE:Factory/.cmocka.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cmocka" Changes: -------- --- /work/SRC/openSUSE:Factory/cmocka/cmocka.changes 2014-09-03 19:37:50.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.cmocka.new/cmocka.changes 2014-09-12 10:04:03.000000000 +0200 @@ -1,0 +2,9 @@ +Thu Sep 11 15:03:12 UTC 2014 - [email protected] + +- Update to version 0.4.1 + * Added CMOCKA_TEST_ABORT env variable to leave threading apps. + * Fixed count parameter of expect_check() macro. + * Fixed reporting the number of tests. + * Fixed cmake config files. + +------------------------------------------------------------------- @@ -4,0 +14,5 @@ + +------------------------------------------------------------------- +Tue Aug 26 13:23:43 UTC 2014 - [email protected] + +- Add BuildRequire for pkg-config. Old: ---- cmocka-0.4.0.tar.xz New: ---- cmocka-0.4.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cmocka.spec ++++++ --- /var/tmp/diff_new_pack.mG1bE0/_old 2014-09-12 10:04:04.000000000 +0200 +++ /var/tmp/diff_new_pack.mG1bE0/_new 2014-09-12 10:04:04.000000000 +0200 @@ -21,7 +21,7 @@ BuildRequires: pkg-config Name: cmocka -Version: 0.4.0 +Version: 0.4.1 Release: 0 # Summary: Lightweight library to simplify and generalize unit tests for C @@ -143,8 +143,9 @@ %{_includedir}/cmocka.h %{_libdir}/libcmocka.so %{_libdir}/pkgconfig/cmocka.pc -%{_libdir}/cmake/cmocka-config-version.cmake -%{_libdir}/cmake/cmocka-config.cmake +%dir %{_libdir}/cmake/cmocka +%{_libdir}/cmake/cmocka/cmocka-config-version.cmake +%{_libdir}/cmake/cmocka/cmocka-config.cmake %files -n libcmocka-devel-static %defattr(-,root,root) ++++++ cmocka-0.4.0.tar.xz -> cmocka-0.4.1.tar.xz ++++++ Files old/cmocka-0.4.0/.ycm_extra_conf.pyc and new/cmocka-0.4.1/.ycm_extra_conf.pyc differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmocka-0.4.0/CMakeLists.txt new/cmocka-0.4.1/CMakeLists.txt --- old/cmocka-0.4.0/CMakeLists.txt 2014-04-11 15:43:46.000000000 +0200 +++ new/cmocka-0.4.1/CMakeLists.txt 2014-05-22 14:40:29.000000000 +0200 @@ -8,7 +8,7 @@ set(APPLICATION_VERSION_MAJOR "0") set(APPLICATION_VERSION_MINOR "4") -set(APPLICATION_VERSION_PATCH "0") +set(APPLICATION_VERSION_PATCH "1") set(APPLICATION_VERSION "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}") @@ -19,7 +19,7 @@ # Increment AGE. Set REVISION to 0 # If the source code was changed, but there were no interface changes: # Increment REVISION. -set(LIBRARY_VERSION "0.2.0") +set(LIBRARY_VERSION "0.2.1") set(LIBRARY_SOVERSION "0") # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked @@ -67,14 +67,16 @@ ) # cmake config files -configure_file(cmocka-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmocka-config.cmake @ONLY) -configure_file(cmocka-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmocka-config-version.cmake @ONLY) +set(CMOCKA_LIBRARY_NAME @CMAKE_SHARED_LIBRARY_PREFIX@${PROJECT_NAME}@CMAKE_SHARED_LIBRARY_SUFFIX@) + +configure_file(${PROJECT_NAME}-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake @ONLY) +configure_file(${PROJECT_NAME}-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake @ONLY) install( FILES - ${CMAKE_CURRENT_BINARY_DIR}/cmocka-config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/cmocka-config-version.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION - ${CMAKE_INSTALL_DIR} + ${CMAKE_INSTALL_DIR}/${PROJECT_NAME} COMPONENT devel ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmocka-0.4.0/CPackConfig.cmake new/cmocka-0.4.1/CPackConfig.cmake --- old/cmocka-0.4.0/CPackConfig.cmake 2013-11-06 08:12:58.000000000 +0100 +++ new/cmocka-0.4.1/CPackConfig.cmake 2014-04-14 09:23:21.000000000 +0200 @@ -19,7 +19,7 @@ ### source generator set(CPACK_SOURCE_GENERATOR "TGZ") -set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;/obj/;tags;cscope.*") +set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;/obj/;tags;cscope.*;.ycm_extra_conf.pyc") set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") if (WIN32) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmocka-0.4.0/ChangeLog new/cmocka-0.4.1/ChangeLog --- old/cmocka-0.4.0/ChangeLog 2014-04-11 15:43:46.000000000 +0200 +++ new/cmocka-0.4.1/ChangeLog 2014-05-22 14:40:05.000000000 +0200 @@ -1,3 +1,10 @@ +Thu May 22 2014 Andreas Schneider <[email protected]> + * cmocka: version 0.4.1 + * Added CMOCKA_TEST_ABORT env variable to leave threading apps. + * Fixed count parameter of expect_check() macro. + * Fixed reporting the number of tests. + * Fixed cmake config files. + Fri Apr 11 2014 Andreas Schneider <[email protected]> * cmocka: version 0.4.0 * Added support for group testing. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmocka-0.4.0/cmocka-config.cmake.in new/cmocka-0.4.1/cmocka-config.cmake.in --- old/cmocka-0.4.0/cmocka-config.cmake.in 2014-01-22 16:10:30.000000000 +0100 +++ new/cmocka-0.4.1/cmocka-config.cmake.in 2014-05-22 14:19:53.000000000 +0200 @@ -7,5 +7,5 @@ set(CMOCKA_INCLUDE_DIR @INCLUDE_INSTALL_DIR@) endif() -set(CMOCKA_LIRBARY @LIB_INSTALL_DIR@/cmocka.so) -set(CMOCKA_LIRBARIES @LIB_INSTALL_DIR@/cmocka.so) +set(CMOCKA_LIBRARY @LIB_INSTALL_DIR@/@CMOCKA_LIBRARY_NAME@) +set(CMOCKA_LIBRARIES @LIB_INSTALL_DIR@/@CMOCKA_LIBRARY_NAME@) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmocka-0.4.0/coverity/coverity_assert_model.c new/cmocka-0.4.1/coverity/coverity_assert_model.c --- old/cmocka-0.4.0/coverity/coverity_assert_model.c 2013-07-29 19:40:12.000000000 +0200 +++ new/cmocka-0.4.1/coverity/coverity_assert_model.c 2014-04-14 21:37:54.000000000 +0200 @@ -21,6 +21,16 @@ __coverity_panic__(); } +void _assert_return_code(const LargestIntegralType result, + size_t rlen, + const LargestIntegralType error, + const char * const expression, + const char * const file, + const int line) +{ + __coverity_panic__(); +} + void _assert_string_equal(const char * const a, const char * const b, const char * const file, const int line) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmocka-0.4.0/doc/mainpage.dox new/cmocka-0.4.1/doc/mainpage.dox --- old/cmocka-0.4.0/doc/mainpage.dox 2013-12-19 18:03:57.000000000 +0100 +++ new/cmocka-0.4.1/doc/mainpage.dox 2014-04-15 17:01:10.000000000 +0200 @@ -82,4 +82,18 @@ <a href="https://lwn.net/Articles/558106/">Learn more ...</a> +@section main-threads Threading + +cmocka is not thread safe and it is not the goal of it to be it. However if +you use cmocka for writing tests in an application which uses threads, you +can set the following envionment variable: + +<pre> + CMOCKA_TEST_ABORT='1' ./my_threading_test +</pre> + +With this environment variable set to '1', cmocka will call <tt>abort()</tt> if +a test fails. Else it is likely that you will run into deadlocks with mutexes +or other funny errors. + */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmocka-0.4.0/include/cmocka.h new/cmocka-0.4.1/include/cmocka.h --- old/cmocka-0.4.0/include/cmocka.h 2014-04-11 15:43:46.000000000 +0200 +++ new/cmocka-0.4.1/include/cmocka.h 2014-05-20 11:03:36.000000000 +0200 @@ -389,7 +389,7 @@ #else #define expect_check(function, parameter, check_function, check_data) \ _expect_check(#function, #parameter, __FILE__, __LINE__, check_function, \ - cast_to_largest_integral_type(check_data), NULL, 0) + cast_to_largest_integral_type(check_data), NULL, 1) #endif #ifdef DOXYGEN @@ -1294,6 +1294,17 @@ #ifdef DOXYGEN /** * @brief Forces the test to fail immediately and quit, printing the reason. + * + * @code + * fail_msg("This is some error message for test"); + * @endcode + * + * or + * + * @code + * char *error_msg = "This is some error message for test"; + * fail_msg("%s", error_msg); + * @endcode */ void fail_msg(const char *msg, ...); #else @@ -1351,9 +1362,11 @@ unit_test(test), \ _unit_test_teardown(test, teardown) +/** Initializes a UnitTest structure for a group setup function. */ #define group_test_setup(setup) \ { "group_" #setup, setup, UNIT_TEST_FUNCTION_TYPE_GROUP_SETUP } +/** Initializes a UnitTest structure for a group teardown function. */ #define group_test_teardown(teardown) \ { "group_" #teardown, teardown, UNIT_TEST_FUNCTION_TYPE_GROUP_TEARDOWN } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmocka-0.4.0/src/cmocka.c new/cmocka-0.4.1/src/cmocka.c --- old/cmocka-0.4.0/src/cmocka.c 2014-04-11 15:09:35.000000000 +0200 +++ new/cmocka-0.4.1/src/cmocka.c 2014-04-15 17:22:30.000000000 +0200 @@ -297,8 +297,13 @@ /* Exit the currently executing test. */ -static void exit_test(const int quit_application) { - if (global_running_test) { +static void exit_test(const int quit_application) +{ + const char *abort_test = getenv("CMOCKA_TEST_ABORT"); + + if (abort_test != NULL && abort_test[0] == '1') { + abort(); + } else if (global_running_test) { longjmp(global_run_test_env, 1); } else if (quit_application) { exit(-1); @@ -1778,19 +1783,35 @@ size_t setups = 0; /* Number of teardown functions. */ size_t teardowns = 0; + size_t i; /* * A stack of test states. A state is pushed on the stack * when a test setup occurs and popped on tear down. */ TestState* test_states = (TestState*)malloc(number_of_tests * sizeof(*test_states)); - size_t number_of_test_states = 0; + /* The number of test states which should be 0 at the end */ + long number_of_test_states = 0; /* Names of the tests that failed. */ const char** failed_names = (const char**)malloc(number_of_tests * sizeof(*failed_names)); void **current_state = NULL; - print_message("[==========] Running %"PRIdS " test(s).\n", number_of_tests); + /* Count setup and teardown functions */ + for (i = 0; i < number_of_tests; i++) { + const UnitTest * const test = &tests[i]; + + if (test->function_type == UNIT_TEST_FUNCTION_TYPE_SETUP) { + setups++; + } + + if (test->function_type == UNIT_TEST_FUNCTION_TYPE_TEARDOWN) { + teardowns++; + } + } + + print_message("[==========] Running %"PRIdS " test(s).\n", + number_of_tests - setups - teardowns); /* Make sure LargestIntegralType is at least the size of a pointer. */ assert_true(sizeof(LargestIntegralType) >= sizeof(void*)); @@ -1817,7 +1838,6 @@ current_state = ¤t_TestState->state; *current_state = NULL; run_next_test = 1; - setups ++; break; } case UNIT_TEST_FUNCTION_TYPE_TEARDOWN: @@ -1826,7 +1846,6 @@ current_TestState = &test_states[--number_of_test_states]; test_check_point = current_TestState->check_point; current_state = ¤t_TestState->state; - teardowns ++; break; default: print_error("Invalid unit test function type %d\n", @@ -1878,8 +1897,7 @@ print_message("[==========] %"PRIdS " test(s) run.\n", tests_executed); print_error("[ PASSED ] %"PRIdS " test(s).\n", tests_executed - total_failed); - if (total_failed) { - size_t i; + if (total_failed > 0) { print_error("[ FAILED ] %"PRIdS " test(s), listed below:\n", total_failed); for (i = 0; i < total_failed; i++) { print_error("[ FAILED ] %s\n", failed_names[i]); @@ -1888,7 +1906,7 @@ print_error("\n %"PRIdS " FAILED TEST(S)\n", total_failed); } - if (number_of_test_states) { + if (number_of_test_states != 0) { print_error("[ ERROR ] Mismatched number of setup %"PRIdS " and " "teardown %"PRIdS " functions\n", setups, teardowns); total_failed = (size_t)-1; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
