diff --git a/.vscode/settings.json b/.vscode/settings.json index ee33728..2954b1f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -75,6 +75,10 @@ "xstring": "cpp", "xtree": "cpp" }, + "cmake.configureArgs": [ + "-DCPPSPEC_BUILD_TESTS=YES", + "-DCPPSPEC_BUILD_EXAMPLES=YES" + ], "C_Cpp.intelliSenseEngine": "disabled", "C_Cpp.autocomplete": "disabled", "C_Cpp.errorSquiggles": "disabled", @@ -100,4 +104,4 @@ } ] }, -} \ No newline at end of file +} diff --git a/CMakeLists.txt b/CMakeLists.txt index 20619aa..fbdb5c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,9 +64,9 @@ function(discover_specs spec_folder) endfunction(discover_specs) # OPTIONS -option(CPPSPEC_BUILD_TESTS "Build C++Spec tests" OFF) -option(CPPSPEC_BUILD_EXAMPLES "Build C++Spec examples" OFF) -option(CPPSPEC_BUILD_DOCS "Build C++Spec documentation" OFF) +option(CPPSPEC_BUILD_TESTS "Build C++Spec tests") +option(CPPSPEC_BUILD_EXAMPLES "Build C++Spec examples") +option(CPPSPEC_BUILD_DOCS "Build C++Spec documentation") if(CPPSPEC_BUILD_TESTS) enable_testing() @@ -122,4 +122,4 @@ if(CPPSPEC_BUILD_DOCS) "Doxygen needs to be installed to generate documentation." "Please install from https://github.com/doxygen/doxygen/releases") endif(DOXYGEN_FOUND) -endif(CPPSPEC_BUILD_DOCS) \ No newline at end of file +endif(CPPSPEC_BUILD_DOCS) diff --git a/include/cppspec.hpp b/include/cppspec.hpp index c6e49db..6b1022c 100755 --- a/include/cppspec.hpp +++ b/include/cppspec.hpp @@ -45,6 +45,13 @@ : EXIT_FAILURE; \ } +#define CPPSPEC_SPEC(spec_name) \ + int spec_name_spec(int argc, char **argv) { \ + return CppSpec::parse(argc, argv).add_spec(spec_name).exec() \ + ? EXIT_SUCCESS \ + : EXIT_FAILURE; \ + } + #endif /*>>>>>>>>>>>>>>>>>>> TYPEDEFS <<<<<<<<<<<<<<<<<<<<<*/