mirror of
https://github.com/boostorg/test.git
synced 2026-02-02 09:12:10 +00:00
Adding an example on datasets + ignores
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -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/
|
||||
|
||||
18
doc/v2/snippet/dataset_1/CMakeLists.txt
Normal file
18
doc/v2/snippet/dataset_1/CMakeLists.txt
Normal file
@@ -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)
|
||||
|
||||
|
||||
12
doc/v2/snippet/dataset_1/test_file.cpp
Normal file
12
doc/v2/snippet/dataset_1/test_file.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(first_test)
|
||||
{
|
||||
BOOST_CHECK(true);
|
||||
|
||||
int i = 1;
|
||||
BOOST_CHECK_EQUAL(i, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user