Skip to content

Commit b34e92b

Browse files
committed
header-only test file
1 parent ab1351a commit b34e92b

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ endif()
2323
file(GLOB_RECURSE BOOST_JSON_TESTS_FILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp)
2424
list(FILTER BOOST_JSON_TESTS_FILES EXCLUDE REGEX cmake_install_test/.*$)
2525
list(FILTER BOOST_JSON_TESTS_FILES EXCLUDE REGEX cmake-subdir/.*$)
26+
list(FILTER BOOST_JSON_TESTS_FILES EXCLUDE REGEX header_only\.cpp$)
2627
list(FILTER BOOST_JSON_TESTS_FILES EXCLUDE REGEX intrusive_macros\.cpp$)
2728
list(FILTER BOOST_JSON_TESTS_FILES EXCLUDE REGEX limits\.cpp$)
2829
list(FILTER BOOST_JSON_TESTS_FILES EXCLUDE REGEX no_exceptions\.cpp$)
@@ -54,6 +55,12 @@ target_compile_definitions(boost_json-limits PRIVATE
5455
add_test(NAME boost_json-limits COMMAND boost_json-limits)
5556
add_dependencies(tests boost_json-limits)
5657

58+
add_executable(boost_json-header_only ${EXCLUDE_TESTS_FROM_ALL} header_only.cpp Jamfile)
59+
boost_json_setup_properties(boost_json-header_only)
60+
61+
add_test(NAME boost_json-header_only COMMAND boost_json-header_only)
62+
add_dependencies(tests boost_json-header_only)
63+
5764
add_executable(boost_json-no_exceptions ${EXCLUDE_TESTS_FROM_ALL} no_exceptions.cpp main.cpp ../src/src.cpp Jamfile)
5865
boost_json_setup_properties(boost_json-no_exceptions)
5966

test/Jamfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ run limits.cpp main.cpp /boost/json//json_sources
8787
<define>BOOST_JSON_STACK_BUFFER_SIZE=256
8888
;
8989

90+
run header_only.cpp
91+
: requirements
92+
<include>../include
93+
<dependency>/boost/json//boost_json
94+
;
95+
9096
run no_exceptions.cpp main.cpp /boost/json//json_sources
9197
: requirements
9298
<exception-handling>off
@@ -103,5 +109,5 @@ boost-pretty-printers.test-gdb-printers gdb-printers
103109
;
104110
explicit gdb-printers ;
105111

106-
alias common : $(SOURCES:B) limits no_exceptions intrusive_macros ;
112+
alias common : $(SOURCES:B) limits header_only no_exceptions intrusive_macros ;
107113
alias heavy : $(HEAVY_SOURCES:B) ;

test/header_only.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <boost/json/src.hpp>
2+
3+
int main(int argc, char **argv)
4+
{
5+
boost::json::value jv;
6+
jv.emplace_object();
7+
return 0;
8+
}

0 commit comments

Comments
 (0)