2
0
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:
Raffi Enficiaud
2014-12-09 14:56:03 +01:00
parent 1eaffb96ce
commit 83dbfe73dc
3 changed files with 31 additions and 0 deletions

1
.gitignore vendored
View File

@@ -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/

View 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)

View 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);
}