From 83dbfe73dcf045ade1e98ac7088dfb0123c474f3 Mon Sep 17 00:00:00 2001 From: Raffi Enficiaud Date: Tue, 9 Dec 2014 14:56:03 +0100 Subject: [PATCH] Adding an example on datasets + ignores --- .gitignore | 1 + doc/v2/snippet/dataset_1/CMakeLists.txt | 18 ++++++++++++++++++ doc/v2/snippet/dataset_1/test_file.cpp | 12 ++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 doc/v2/snippet/dataset_1/CMakeLists.txt create mode 100644 doc/v2/snippet/dataset_1/test_file.cpp diff --git a/.gitignore b/.gitignore index 83988962..40449a03 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ doc/v2/html/boost_test/ doc/v2/html/index.html doc/v2/html/standalone_HTML.manifest test_executable +doc/v2/snippet/dataset_1/build/ diff --git a/doc/v2/snippet/dataset_1/CMakeLists.txt b/doc/v2/snippet/dataset_1/CMakeLists.txt new file mode 100644 index 00000000..1645911e --- /dev/null +++ b/doc/v2/snippet/dataset_1/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8.11) +project(my_first_test) +enable_testing() + +# not meant to be included in the documentation +set(BOOST_ROOT ${CMAKE_SOURCE_DIR}/../../../../../..) +message(STATUS "$BOOST_ROOT = ${BOOST_ROOT}") +# creates the executable +add_executable(test_executable test_file.cpp) +# indicates the include paths +target_include_directories(test_executable PRIVATE ${BOOST_ROOT}) +# indicates the link paths +target_link_libraries(test_executable ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + +# declares a test with our executable +add_test(NAME test1 COMMAND test_executable) + + diff --git a/doc/v2/snippet/dataset_1/test_file.cpp b/doc/v2/snippet/dataset_1/test_file.cpp new file mode 100644 index 00000000..ecd85c14 --- /dev/null +++ b/doc/v2/snippet/dataset_1/test_file.cpp @@ -0,0 +1,12 @@ +#define BOOST_TEST_MAIN +#include + + +BOOST_AUTO_TEST_CASE(first_test) +{ + BOOST_CHECK(true); + + int i = 1; + BOOST_CHECK_EQUAL(i, 1); +} +