From 7e1c04c989d85f263665e1fc6f565ee8526f52c7 Mon Sep 17 00:00:00 2001 From: Gregory A Lundberg Date: Wed, 1 Nov 2017 21:26:37 -0500 Subject: [PATCH] Renamed the target and binary for the Boost unit tests from `test` to `boost_unit_tests` This quells warnings from CMake about reserved target names, and reduces confusion about which `test` is intended: the wesnoth executable or the standard shell command. --- .gitignore | 1 + SConstruct | 12 ++++++------ changelog | 5 +++++ source_lists/{test => boost_unit_tests} | 0 src/CMakeLists.txt | 10 +++++----- src/SConscript | 8 ++++---- 6 files changed, 21 insertions(+), 15 deletions(-) rename source_lists/{test => boost_unit_tests} (100%) diff --git a/.gitignore b/.gitignore index 981984cb8d66d..f6df19bf6feaa 100644 --- a/.gitignore +++ b/.gitignore @@ -133,6 +133,7 @@ userdata # testing /test* +/boost_unit_tests* !/test_wrapper.sh src/test error*.log diff --git a/SConstruct b/SConstruct index 00baab94d171b..e081fc6c95bff 100755 --- a/SConstruct +++ b/SConstruct @@ -46,7 +46,7 @@ def OptionalPath(key, val, env): opts.AddVariables( ListVariable('default_targets', 'Targets that will be built if no target is specified in command line.', - "wesnoth,wesnothd", Split("wesnoth wesnothd campaignd test")), + "wesnoth,wesnothd", Split("wesnoth wesnothd campaignd boost_unit_tests")), EnumVariable('build', 'Build variant: release, debug, or profile', "release", ["release", "debug", "profile"]), PathVariable('build_dir', 'Build all intermediate files(objects, test programs, etc) under this dir', "build", PathVariable.PathAccept), ('extra_flags_config', "Extra compiler and linker flags to use for configuration and all builds. Whether they're compiler or linker is determined by env.ParseFlags. Unknown flags are compile flags by default. This applies to all extra_flags_* variables", ""), @@ -201,11 +201,11 @@ Important switches include: With no arguments, the recipe builds wesnoth and wesnothd. Available build targets include the individual binaries: - wesnoth wesnothd campaignd test + wesnoth wesnothd campaignd boost_unit_tests You can make the following special build targets: - all = wesnoth wesnothd campaignd test (*). + all = wesnoth wesnothd campaignd boost_unit_tests (*). TAGS = build tags for Emacs (*). wesnoth-deps.png = project dependency graph install = install all executables that currently exist, and any data needed @@ -431,8 +431,8 @@ if env["prereqs"]: have_test_prereqs = have_client_prereqs and conf.CheckBoost('unit_test_framework') \ or Warning("Unit tests are disabled because their prerequisites are not met") test_env = conf.Finish() - if not have_test_prereqs and "test" in env["default_targets"]: - env["default_targets"].remove("test") + if not have_test_prereqs and "boost_unit_tests" in env["default_targets"]: + env["default_targets"].remove("boost_unit_tests") print(" " + env.subst("If any config checks fail, look in $build_dir/config.log for details")) print(" If a check fails spuriously due to caching, use --config=force to force its rerun") @@ -595,7 +595,7 @@ except: Export(Split("env client_env test_env have_client_prereqs have_server_prereqs have_test_prereqs")) SConscript(dirs = Split("po doc packaging/windows packaging/systemd")) -binaries = Split("wesnoth wesnothd campaignd test") +binaries = Split("wesnoth wesnothd campaignd boost_unit_tests") builds = { "release" : dict(CCFLAGS = Split(rel_comp_flags) , LINKFLAGS = Split(rel_link_flags)), "debug" : dict(CCFLAGS = Split(debug_flags) , CPPDEFINES = Split(glibcxx_debug_flags)), diff --git a/changelog b/changelog index 5a4f65125f9fe..63f6319b6c73f 100644 --- a/changelog +++ b/changelog @@ -4,6 +4,11 @@ Version 1.13.10+dev: have linger=no in [end_level]. * A Tale of Two Brothers: * Added a full set of hints on easy difficulty. + * Contiuous Integration (CI) and Unit testing + * Renamed the target and binary for the Boost unit tests from `test` to + `boost_unit_tests`. This quells warnings from CMake about reserved target + names, and reduces confusion about which `test` is intended: the wesnoth + executable or the standard shell command. * Language and i18n: * Updated translations: Chinese (Simplified) * Lua API: diff --git a/source_lists/test b/source_lists/boost_unit_tests similarity index 100% rename from source_lists/test rename to source_lists/boost_unit_tests diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 72adedf002b24..44a2b166c7a01 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -485,7 +485,7 @@ if(ENABLE_TESTS) add_definitions(-DBOOST_TEST_DYN_LINK) - GetSources("test" test_SRC) + GetSources("boost_unit_tests" test_SRC) if(ENABLE_GAME) set(test_LIB @@ -514,16 +514,16 @@ if(ENABLE_TESTS) "${CXX_FLAG_NO_USELESS_CAST}" ) - add_executable(test + add_executable(boost_unit_tests ${test_SRC} ) - target_link_libraries(test + target_link_libraries(boost_unit_tests ${test_LIB} ${game-external-libs} boost_unit_test_framework ) - set_target_properties(test - PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}test${BINARY_SUFFIX} + set_target_properties(boost_unit_tests + PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}boost_unit_tests${BINARY_SUFFIX} ) endif(ENABLE_TESTS) diff --git a/src/SConscript b/src/SConscript index 5ca73a310a0e7..a506cd5ae4b9b 100644 --- a/src/SConscript +++ b/src/SConscript @@ -80,7 +80,7 @@ if env["png"]: libwesnoth_sdl = client_env.Library("wesnoth_sdl", libwesnoth_sdl_sources) #---wesnoth--- -# Used by both 'wesnoth' and 'test' targets +# Used by both 'wesnoth' and 'boost_unit_tests' targets wesnoth_sources = GetSources("wesnoth") @@ -161,9 +161,9 @@ env.WesnothProgram("wesnothd", wesnothd_sources + [libwesnoth_core, env["wesnoth campaignd_sources = GetSources("campaignd") env.WesnothProgram("campaignd", campaignd_sources + [libwesnoth_core], have_server_prereqs, OBJPREFIX = "campaignd_") -#---test--- -test_sources = GetSources("test") -test = test_env.WesnothProgram("test", test_sources + [libwesnoth_extras, libwesnoth_core, libwesnoth, libwesnoth_sdl, libwesnoth_extras], have_test_prereqs) +#---boost_unit_tests--- +test_sources = GetSources("boost_unit_tests") +boost_unit_tests = test_env.WesnothProgram("boost_unit_tests", test_sources + [libwesnoth_extras, libwesnoth_core, libwesnoth, libwesnoth_sdl, libwesnoth_extras], have_test_prereqs) #---end of getting sources--- sources = []