diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 3279805..8e18ecf 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.0.1 +current_version = 2.0.2 commit = False [bumpversion:file:CMakeLists.txt] diff --git a/CMakeLists.txt b/CMakeLists.txt index d22a474..27c5666 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ endif () # Project setup & environment variables -set(PROJECT_VERSION "2.0.1") +set(PROJECT_VERSION "2.0.2") set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) set(GettextTranslate_ALL 1) set(GettextTranslate_GMO_BINARY 1) diff --git a/ChangeLog b/ChangeLog index b19e3ff..6c14667 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-20 Franklin "Snaipe" Mathieu + + * criterion: version 2.0.2 + * Fix: Fixed rare bug where tests from only one compilation unit would run. + 2015-09-19 Franklin "Snaipe" Mathieu * criterion: version 2.0.1 diff --git a/README.md b/README.md index 81fe988..29b6c74 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,10 @@ the user would have with other frameworks: ## Downloads -* [Linux (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.1/criterion-v2.0.1-linux-x86_64.tar.bz2) -* [OS X (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.1/criterion-v2.0.1-osx-x86_64.tar.bz2) -* [Windows (MSVC - x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.1/criterion-v2.0.1-windows-msvc-x86_64.tar.bz2) -* [Windows (MinGW - x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.1/criterion-v2.0.1-windows-mingw-x86_64.tar.bz2) +* [Linux (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.2/criterion-v2.0.2-linux-x86_64.tar.bz2) +* [OS X (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.2/criterion-v2.0.2-osx-x86_64.tar.bz2) +* [Windows (MSVC - x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.2/criterion-v2.0.2-windows-msvc-x86_64.tar.bz2) +* [Windows (MinGW - x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.2/criterion-v2.0.2-windows-mingw-x86_64.tar.bz2) If you have a different platform, you can still [build the library from source](http://criterion.readthedocs.org/en/latest/setup.html#installation) diff --git a/appveyor.yml b/appveyor.yml index 01f4a66..70d38df 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.0.1_b{build}-{branch} +version: 2.0.2_b{build}-{branch} os: Visual Studio 2015 diff --git a/doc/conf.py b/doc/conf.py index 4d6fd96..2ecadbe 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -39,7 +39,7 @@ copyright = u'2015, Franklin "Snaipe" Mathieu' # built documents. # # The short X.Y version. -version = '2.0.1' +version = '2.0.2' # The full version, including alpha/beta/rc tags. release = version diff --git a/include/criterion/criterion.h b/include/criterion/criterion.h index 82dab63..f72eba0 100644 --- a/include/criterion/criterion.h +++ b/include/criterion/criterion.h @@ -53,13 +53,15 @@ .line_ = __LINE__, \ __VA_ARGS__ \ )); \ - SECTION_("cr_tst") \ struct criterion_test IDENTIFIER_(Category, Name, meta) = { \ #Name, \ #Category, \ IDENTIFIER_(Category, Name, impl), \ &IDENTIFIER_(Category, Name, extra) \ - } SECTION_SUFFIX_; \ + }; \ + SECTION_("cr_tst") \ + struct criterion_test *IDENTIFIER_(Category, Name, ptr) \ + = &IDENTIFIER_(Category, Name, meta) SECTION_SUFFIX_; \ TEST_PROTOTYPE_(Category, Name) # define TestSuite(...) CR_EXPAND(TestSuite_(__VA_ARGS__, .sentinel_ = 0)) @@ -70,11 +72,13 @@ .line_ = 0, \ __VA_ARGS__ \ )); \ - SECTION_("cr_sts") \ struct criterion_suite SUITE_IDENTIFIER_(Name, meta) = { \ #Name, \ &SUITE_IDENTIFIER_(Name, extra), \ - } SECTION_SUFFIX_ + }; \ + SECTION_("cr_sts") \ + struct criterion_suite *SUITE_IDENTIFIER_(Name, ptr) \ + = &SUITE_IDENTIFIER_(Name, meta) SECTION_SUFFIX_ CR_BEGIN_C_API diff --git a/src/core/runner.c b/src/core/runner.c index b25f45c..4333ebd 100644 --- a/src/core/runner.c +++ b/src/core/runner.c @@ -45,14 +45,14 @@ #endif #ifdef _MSC_VER -struct criterion_test SECTION_START_(cr_tst); -struct criterion_suite SECTION_START_(cr_sts); -struct criterion_test SECTION_END_(cr_tst); -struct criterion_suite SECTION_END_(cr_sts); +struct criterion_test *SECTION_START_(cr_tst); +struct criterion_suite *SECTION_START_(cr_sts); +struct criterion_test *SECTION_END_(cr_tst); +struct criterion_suite *SECTION_END_(cr_sts); #endif -IMPL_SECTION_LIMITS(struct criterion_test, cr_tst); -IMPL_SECTION_LIMITS(struct criterion_suite, cr_sts); +IMPL_SECTION_LIMITS(struct criterion_test*, cr_tst); +IMPL_SECTION_LIMITS(struct criterion_suite*, cr_sts); // This is here to make the test suite & test sections non-empty TestSuite(); @@ -98,11 +98,11 @@ struct criterion_test_set *criterion_init(void) { struct criterion_ordered_set *suites = new_ordered_set(cmp_suite, dtor_suite_set); FOREACH_SUITE_SEC(s) { - if (!s->name) - break; + if (!*s) + continue; struct criterion_suite_set css = { - .suite = *s, + .suite = **s, }; insert_ordered_set(suites, &css, sizeof (css)); } @@ -118,13 +118,13 @@ struct criterion_test_set *criterion_init(void) { }; FOREACH_TEST_SEC(test) { - if (!test->category) - break; - - if (!*test->category) + if (!*test) continue; - criterion_register_test(set, test); + if (!(*test)->category) + continue; + + criterion_register_test(set, *test); } return set; diff --git a/src/core/runner.h b/src/core/runner.h index 74a3356..0b6ad05 100644 --- a/src/core/runner.h +++ b/src/core/runner.h @@ -27,19 +27,19 @@ # include "criterion/types.h" # include "compat/pipe.h" -DECL_SECTION_LIMITS(struct criterion_test, cr_tst); -DECL_SECTION_LIMITS(struct criterion_suite, cr_sts); +DECL_SECTION_LIMITS(struct criterion_test*, cr_tst); +DECL_SECTION_LIMITS(struct criterion_suite*, cr_sts); struct criterion_test_set *criterion_init(void); # define FOREACH_TEST_SEC(Test) \ - for (struct criterion_test *Test = GET_SECTION_START(cr_tst); \ - Test < (struct criterion_test*) GET_SECTION_END(cr_tst); \ + for (struct criterion_test **Test = GET_SECTION_START(cr_tst); \ + Test < (struct criterion_test**) GET_SECTION_END(cr_tst); \ ++Test) # define FOREACH_SUITE_SEC(Suite) \ - for (struct criterion_suite *Suite = GET_SECTION_START(cr_sts); \ - Suite < (struct criterion_suite*) GET_SECTION_END(cr_sts); \ + for (struct criterion_suite **Suite = GET_SECTION_START(cr_sts); \ + Suite < (struct criterion_suite**) GET_SECTION_END(cr_sts); \ ++Suite) extern s_pipe_handle *g_worker_pipe;