diff options
Diffstat (limited to 'tests/actions')
-rw-r--r-- | tests/actions/make/test_make_pch.lua | 4 | ||||
-rw-r--r-- | tests/actions/make/test_wiidev.lua | 2 | ||||
-rw-r--r-- | tests/actions/vstudio/cs2005/buildevents.lua | 53 | ||||
-rw-r--r-- | tests/actions/vstudio/test_vs2010_vcxproj.lua | 11 |
4 files changed, 67 insertions, 3 deletions
diff --git a/tests/actions/make/test_make_pch.lua b/tests/actions/make/test_make_pch.lua index 18e6026..6d30ef1 100644 --- a/tests/actions/make/test_make_pch.lua +++ b/tests/actions/make/test_make_pch.lua @@ -66,6 +66,7 @@ _.pchrules(prj) test.capture [[ ifneq (,$(PCH)) +.NOTPARALLEL: $(GCH) $(PCH) $(GCH): $(PCH) @echo $(notdir $<) $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" @@ -79,6 +80,7 @@ $(GCH): $(PCH) _.pchrules(prj) test.capture [[ ifneq (,$(PCH)) +.NOTPARALLEL: $(GCH) $(PCH) $(GCH): $(PCH) @echo $(notdir $<) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" @@ -98,7 +100,7 @@ $(GCH): $(PCH) test.capture [[ $(OBJDIR)/main.o: main.cpp @echo $(notdir $<) - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" ]] end diff --git a/tests/actions/make/test_wiidev.lua b/tests/actions/make/test_wiidev.lua index f3787a0..d766097 100644 --- a/tests/actions/make/test_wiidev.lua +++ b/tests/actions/make/test_wiidev.lua @@ -33,7 +33,7 @@ cpp.flags(cfg, premake.gcc) test.capture [[ ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ]] diff --git a/tests/actions/vstudio/cs2005/buildevents.lua b/tests/actions/vstudio/cs2005/buildevents.lua new file mode 100644 index 0000000..213de1b --- /dev/null +++ b/tests/actions/vstudio/cs2005/buildevents.lua @@ -0,0 +1,53 @@ +--
+-- tests/actions/vstudio/cs2005/buildevents.lua
+-- Validate the build events in Visual Studio 2005+ .csproj
+-- Copyright (c) 2009-2014 Jason Perkins and the Premake project
+--
+
+ T.vstudio_cs2005_buildevents = { }
+ local suite = T.vstudio_cs2005_buildevents
+ local cs2005 = premake.vstudio.cs2005
+
+--
+-- Setup
+--
+
+ local sln, prj
+
+ function suite.setup()
+ sln = test.createsolution()
+ end
+
+ local function prepare()
+ premake.bake.buildconfigs()
+ prj = premake.solution.getproject(sln, 1)
+ cs2005.buildevents(prj)
+ end
+
+--
+-- Prebuild events
+--
+
+ function suite.prebuildEvents()
+ prebuildcommands { "pre" }
+ prepare()
+ test.capture [[
+ <PropertyGroup>
+ <PreBuildEvent>pre</PreBuildEvent>
+ </PropertyGroup>
+ ]]
+ end
+
+--
+-- Postbuild events
+--
+
+ function suite.postbuildEvents()
+ postbuildcommands { "post" }
+ prepare()
+ test.capture [[
+ <PropertyGroup>
+ <PostBuildEvent>post</PostBuildEvent>
+ </PropertyGroup>
+ ]]
+ end
diff --git a/tests/actions/vstudio/test_vs2010_vcxproj.lua b/tests/actions/vstudio/test_vs2010_vcxproj.lua index c5b3401..c11ec9e 100644 --- a/tests/actions/vstudio/test_vs2010_vcxproj.lua +++ b/tests/actions/vstudio/test_vs2010_vcxproj.lua @@ -2,6 +2,7 @@ local vs10_vcxproj = T.vs2010_vcxproj local include_directory = "bar/foo" local include_directory2 = "baz/foo" + local include_directory_vs_macros = "$(Macro1)/foo/bar/$(Macro2)/baz" local debug_define = "I_AM_ALIVE_NUMBER_FIVE" local vc2010 = premake.vstudio.vc2010 @@ -25,7 +26,8 @@ includedirs { include_directory, - include_directory2 + include_directory2, + include_directory_vs_macros } files { @@ -168,6 +170,13 @@ test.string_contains(buffer,cl_compile_string('Debug').. '.*<AdditionalIncludeDirectories>.*'.. path.translate(include_directory2, '\\') ..';.*</AdditionalIncludeDirectories>') end + function vs10_vcxproj.includeDirectories_debugEntryContains_include_directory_vs_macros() + local buffer = get_buffer() + -- visual studio macros use $ as a prefix, which is a special regex character, so we need to replace them. + local search_string = string.gsub(include_directory_vs_macros, "%$", "%$%") + test.string_contains(buffer,cl_compile_string('Debug').. '.*<AdditionalIncludeDirectories>.*'.. path.translate(search_string, '\\') ..'.*</AdditionalIncludeDirectories>') + end + function vs10_vcxproj.debugContainsPreprossorBlock() local buffer = get_buffer() test.string_contains(buffer,cl_compile_string('Debug').. '.*<PreprocessorDefinitions>.*</PreprocessorDefinitions>') |