From 7a379ed2f7ce2c06fd7557c5610b0970bf85ec86 Mon Sep 17 00:00:00 2001 From: Martin Moene Date: Mon, 23 Nov 2015 23:35:07 +0100 Subject: [PATCH] Only define lest_MODULE() for non-auto test registration See issue #25 --- lest.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lest.hpp b/lest.hpp index 7184780..5087dd9 100644 --- a/lest.hpp +++ b/lest.hpp @@ -99,9 +99,6 @@ #define lest_AND_WHEN( story ) lest_SECTION( lest::text( " And: ") + story ) #define lest_AND_THEN( story ) lest_SECTION( lest::text( " And: ") + story ) -#define lest_MODULE( specification, module ) \ - namespace { lest::add_module _( specification, module ); } - #define lest_TEST \ lest_CASE @@ -112,12 +109,15 @@ namespace { lest::add_test lest_REGISTRAR( specification, lest::test( proposition, lest_FUNCTION ) ); } \ void lest_FUNCTION( lest::env & $ ) -#else +#else // lest_FEATURE_AUTO_REGISTER # define lest_CASE( proposition, ... ) \ proposition, [__VA_ARGS__]( lest::env & $ ) -#endif +#define lest_MODULE( specification, module ) \ + namespace { lest::add_module _( specification, module ); } + +#endif //lest_FEATURE_AUTO_REGISTER #define lest_SETUP( context ) \ for ( int $section = 0, $count = 1; $section < $count; $count -= 0==$section++ )