diff --git a/modules/codelite/tests/test_codelite_config.lua b/modules/codelite/tests/test_codelite_config.lua index 93346113..69d2e01a 100644 --- a/modules/codelite/tests/test_codelite_config.lua +++ b/modules/codelite/tests/test_codelite_config.lua @@ -196,7 +196,7 @@ cmd2 ]] end - function suite.OnProject_PreBuild() + function suite.OnProject_PostBuild() postbuildcommands { "cmd0", "cmd1" } prepare() codelite.project.postBuild(prj) diff --git a/modules/gmake/tests/cpp/test_make_linking.lua b/modules/gmake/tests/cpp/test_make_linking.lua index ebd8de61..ce1b2ce9 100644 --- a/modules/gmake/tests/cpp/test_make_linking.lua +++ b/modules/gmake/tests/cpp/test_make_linking.lua @@ -143,7 +143,7 @@ prepare { "ldFlags", "libs", "ldDeps" } test.capture [[ - ALL_LDFLAGS += $(LDFLAGS) -s + ALL_LDFLAGS += $(LDFLAGS) -Wl,-rpath,'$$ORIGIN/../../build/bin/Debug' -s LIBS += build/bin/Debug/libMyProject2.so LDDEPS += build/bin/Debug/libMyProject2.so ]] @@ -153,7 +153,7 @@ -- Check a linking to a sibling shared library using -l and -L. -- - function suite.links_onSiblingSharedLib() + function suite.links_onSiblingSharedLibRelativeLinks() links "MyProject2" flags { "RelativeLinks" } @@ -260,7 +260,7 @@ -- is stripped -- - function suite.onExternalLibraryWithPath() + function suite.onExternalLibraryWithPathAndVersion() location "MyProject" links { "libs/SomeLib-1.1" } prepare { "libs", } diff --git a/modules/gmake/tests/test_make_tovar.lua b/modules/gmake/tests/test_make_tovar.lua index 0c73474e..5784b47f 100644 --- a/modules/gmake/tests/test_make_tovar.lua +++ b/modules/gmake/tests/test_make_tovar.lua @@ -30,6 +30,6 @@ -- Remove parenthesis. -- - function suite.removesDashes() + function suite.removesParenthesis() test.isequal("MyProject_x86", make.tovar("MyProject (x86)")) end diff --git a/modules/gmake/tests/workspace/test_config_maps.lua b/modules/gmake/tests/workspace/test_config_maps.lua index 38506239..0f3c6328 100644 --- a/modules/gmake/tests/workspace/test_config_maps.lua +++ b/modules/gmake/tests/workspace/test_config_maps.lua @@ -46,7 +46,7 @@ endif -- If a map is present, the configuration change should be applied. -- - function suite.passesThroughConfigs_onNoMap() + function suite.passesThroughConfigs_onMap() configmap { Debug = "Development" } prepare() test.capture [[ @@ -65,7 +65,7 @@ endif -- no mapping should be created. -- - function suite.passesThroughConfigs_onNoMap() + function suite.passesThroughConfigs_onNoMapRemovedConfiguration() removeconfigurations { "Debug" } prepare() test.capture [[ diff --git a/modules/gmake2/tests/test_gmake2_linking.lua b/modules/gmake2/tests/test_gmake2_linking.lua index 62cb2334..4943980b 100644 --- a/modules/gmake2/tests/test_gmake2_linking.lua +++ b/modules/gmake2/tests/test_gmake2_linking.lua @@ -145,7 +145,7 @@ LDDEPS += build/bin/Debug/libMyProject2.a prepare { "ldFlags", "libs", "ldDeps" } test.capture [[ -ALL_LDFLAGS += $(LDFLAGS) -s +ALL_LDFLAGS += $(LDFLAGS) -Wl,-rpath,'$$ORIGIN/../../build/bin/Debug' -s LIBS += build/bin/Debug/libMyProject2.so LDDEPS += build/bin/Debug/libMyProject2.so ]] @@ -155,7 +155,7 @@ LDDEPS += build/bin/Debug/libMyProject2.so -- Check a linking to a sibling shared library using -l and -L. -- - function suite.links_onSiblingSharedLib() + function suite.links_onSiblingSharedLibRelativeLinks() links "MyProject2" flags { "RelativeLinks" } @@ -262,7 +262,7 @@ LIBS += -lSomeLib -- is stripped -- - function suite.onExternalLibraryWithPath() + function suite.onExternalLibraryWithPathAndVersion() location "MyProject" links { "libs/SomeLib-1.1" } prepare { "libs", } diff --git a/modules/self-test/self-test.lua b/modules/self-test/self-test.lua index 7a8fd9b0..3a15d271 100644 --- a/modules/self-test/self-test.lua +++ b/modules/self-test/self-test.lua @@ -37,7 +37,9 @@ function m.executeSelfTest() + m.detectDuplicateTests = true m.loadTestsFromManifests() + m.detectDuplicateTests = false local test, err = m.getTestWithIdentifier(_OPTIONS["test-only"]) if err then diff --git a/modules/self-test/test_declare.lua b/modules/self-test/test_declare.lua index fe31e5b9..9eae15aa 100644 --- a/modules/self-test/test_declare.lua +++ b/modules/self-test/test_declare.lua @@ -36,7 +36,14 @@ error('Duplicate test suite "'.. suiteName .. '"', 2) end - local suite = {} + local _suite = {} + -- Setup a metatable for the test suites to use, this will catch duplicate tests + local suite = setmetatable({}, { + __index = _suite, + __newindex = function (table, key, value) if m.detectDuplicateTests and _suite[key] ~= nil then error('Duplicate test "'.. key .. '"', 2) end _suite[key] = value end, + __pairs = function (table) return pairs(_suite) end, + __ipairs = function (table) return ipairs(_suite) end, + }) suite._SCRIPT_DIR = _SCRIPT_DIR suite._TESTS_DIR = _TESTS_DIR diff --git a/modules/vstudio/tests/vc200x/test_debug_settings.lua b/modules/vstudio/tests/vc200x/test_debug_settings.lua index cbfb1c38..7ffd087c 100644 --- a/modules/vstudio/tests/vc200x/test_debug_settings.lua +++ b/modules/vstudio/tests/vc200x/test_debug_settings.lua @@ -126,7 +126,7 @@ Environment="key=value foo=bar" -- flag is set. -- - function suite.environmentVarsSet_onDebugEnvs() + function suite.environmentVarsSet_onDebugEnvsAndDebugEnvsDontMerge() debugenvs { "key=value" } flags { "DebugEnvsDontMerge" } prepare() diff --git a/modules/vstudio/tests/vc2010/test_compile_settings.lua b/modules/vstudio/tests/vc2010/test_compile_settings.lua index ace4adde..a2ad702a 100644 --- a/modules/vstudio/tests/vc2010/test_compile_settings.lua +++ b/modules/vstudio/tests/vc2010/test_compile_settings.lua @@ -260,7 +260,7 @@ -- If defines are specified with escapable characters, they should be escaped. -- - function suite.preprocessorDefinitions_onDefines() + function suite.preprocessorDefinitions_onDefinesWithEscapeCharacters() p.escaper(p.vstudio.vs2010.esc) defines { "&", "<", ">" } prepare() @@ -477,8 +477,32 @@ ]] end + +-- +-- Check handling of the explicitly disabling symbols. +-- Note: VS2013 and older have a bug with setting +-- DebugInformationFormat to None. The workaround +-- is to leave the field blank. +-- function suite.onNoSymbols() - symbols "Off" + symbols 'Off' + prepare() + test.capture [[ + + NotUsing + Level3 + + Disabled + ]] + end + + +-- +-- VS2015 and newer can use DebugInformationFormat None. +-- + function suite.onNoSymbolsVS2015() + symbols 'Off' + p.action.set("vs2015") prepare() test.capture [[ @@ -486,7 +510,6 @@ Level3 None Disabled - ]] end @@ -837,42 +860,6 @@ end --- --- Check handling of the explicitly disabling symbols. --- Note: VS2013 and older have a bug with setting --- DebugInformationFormat to None. The workaround --- is to leave the field blank. --- - function suite.onNoSymbols() - symbols 'Off' - prepare() - test.capture [[ - - NotUsing - Level3 - - Disabled - ]] - end - - --- --- VS2015 and newer can use DebugInformationFormat None. --- - function suite.onNoSymbolsVS2015() - symbols 'Off' - p.action.set("vs2015") - prepare() - test.capture [[ - - NotUsing - Level3 - None - Disabled - ]] - end - - -- -- Check handling of the stringpooling api -- diff --git a/modules/vstudio/tests/vc2010/test_debug_settings.lua b/modules/vstudio/tests/vc2010/test_debug_settings.lua index 8a41f202..614bf3e9 100644 --- a/modules/vstudio/tests/vc2010/test_debug_settings.lua +++ b/modules/vstudio/tests/vc2010/test_debug_settings.lua @@ -92,7 +92,7 @@ -- Multiple environment variables should be separated by a "\n" sequence. -- - function suite.localDebuggerEnv_onDebugEnv() + function suite.localDebuggerEnv_onMultipleDebugEnv() debugenvs { "key=value", "foo=bar" } prepare() test.capture [[ diff --git a/modules/vstudio/tests/vc2010/test_filters.lua b/modules/vstudio/tests/vc2010/test_filters.lua index 30a2e001..5bebc113 100644 --- a/modules/vstudio/tests/vc2010/test_filters.lua +++ b/modules/vstudio/tests/vc2010/test_filters.lua @@ -190,7 +190,7 @@ -- -- Check handling of .asm files -- - function suite.itemGroup_onNoneSection() + function suite.itemGroup_onMasmSection() files { "hello.asm" } prepare() test.capture [[ diff --git a/modules/vstudio/tests/vc2010/test_imagexex_settings.lua b/modules/vstudio/tests/vc2010/test_imagexex_settings.lua index 313ba432..f87e6ec9 100644 --- a/modules/vstudio/tests/vc2010/test_imagexex_settings.lua +++ b/modules/vstudio/tests/vc2010/test_imagexex_settings.lua @@ -45,7 +45,7 @@ -- -- Ensure configuration file is output in ImageXex block -- - function suite.defaultSettings() + function suite.onConfigfile() configfile "testconfig.xml" prepare() test.capture [[ diff --git a/modules/vstudio/tests/vc2010/test_link.lua b/modules/vstudio/tests/vc2010/test_link.lua index 0fd0f87b..12d60205 100644 --- a/modules/vstudio/tests/vc2010/test_link.lua +++ b/modules/vstudio/tests/vc2010/test_link.lua @@ -716,7 +716,7 @@ -- Test ignoring default libraries without extensions specified. -- - function suite.ignoreDefaultLibraries_WithExtensions() + function suite.ignoreDefaultLibraries_WithoutExtensions() ignoredefaultlibraries { "lib1", "lib2.obj" } prepare() test.capture [[ diff --git a/modules/vstudio/tests/vc2010/test_project_refs.lua b/modules/vstudio/tests/vc2010/test_project_refs.lua index d4b66332..51ccca01 100644 --- a/modules/vstudio/tests/vc2010/test_project_refs.lua +++ b/modules/vstudio/tests/vc2010/test_project_refs.lua @@ -80,7 +80,7 @@ -- Managed C++ projects write out references a little differently. -- - function suite.referencesAreRelative_onDifferentProjectLocation() + function suite.referencesAreRelative_onDifferentProjectLocationWithCLR() links { "MyProject" } clr "On" prepare() diff --git a/tests/base/test_path.lua b/tests/base/test_path.lua index 80ba6416..77a08162 100755 --- a/tests/base/test_path.lua +++ b/tests/base/test_path.lua @@ -116,7 +116,7 @@ test.istrue(path.hasdeferredjoin("p1|%{foo}")) end - function suite.deferred_join_OnValidParts() + function suite.has_deferred_join_false() test.isfalse(path.hasdeferredjoin("p1/p2")) end diff --git a/tests/config/test_linkinfo.lua b/tests/config/test_linkinfo.lua index 1365c377..79348646 100755 --- a/tests/config/test_linkinfo.lua +++ b/tests/config/test_linkinfo.lua @@ -77,7 +77,7 @@ -- Shared library should use implibname() if present. -- - function suite.basenameIsTargetName_onTargetName() + function suite.basenameIsImplibName_onTargetName() kind "SharedLib" targetname "MyTarget" implibname "MyTargetImports" diff --git a/tests/config/test_targetinfo.lua b/tests/config/test_targetinfo.lua index 12252a4c..a1d49023 100755 --- a/tests/config/test_targetinfo.lua +++ b/tests/config/test_targetinfo.lua @@ -188,7 +188,7 @@ -- Name should use ".exe" for Xbox360 executables. -- - function suite.nameUsesExe_onWindowsConsoleApp() + function suite.nameUsesExe_onXbox360ConsoleApp() kind "ConsoleApp" system "Xbox360" i = prepare() @@ -265,7 +265,7 @@ -- .NET libraries should always default to ".dll" extensions. -- - function suite.appUsesExe_onDotNet() + function suite.appUsesExe_onDotNetSharedLib() _TARGET_OS = "macosx" language "C#" kind "SharedLib" diff --git a/tests/project/test_vpaths.lua b/tests/project/test_vpaths.lua index e1b6173e..f8db598b 100644 --- a/tests/project/test_vpaths.lua +++ b/tests/project/test_vpaths.lua @@ -100,12 +100,6 @@ test.isequal("Headers/hello.h", run()) end - function suite.MatchFilePattern_ToNestedGroup_Flat() - files { "src/myproject/hello.h" } - vpaths { ["Group/Headers"] = "**.h" } - test.isequal("Group/Headers/hello.h", run()) - end - function suite.MatchFilePattern_ToGroup_Nested() files { "src/myproject/hello.h" } vpaths { ["Headers/*"] = "**.h" }