Skip to content

Commit

Permalink
Merge branch 'master' into no-colors-on-non-tty
Browse files Browse the repository at this point in the history
  • Loading branch information
lanurmi authored May 2, 2018
2 parents ba34e3e + 2e7ca5f commit 9921fc6
Show file tree
Hide file tree
Showing 31 changed files with 155 additions and 95 deletions.
12 changes: 11 additions & 1 deletion Bootstrap.mak
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,17 @@ bsd: $(SRC)
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $? -lm
./build/bootstrap/premake_bootstrap embed
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
$(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)

solaris: $(SRC)
$(SILENT) rm -rf ./bin
$(SILENT) rm -rf ./build
$(SILENT) rm -rf ./obj
mkdir -p build/bootstrap
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $? -lm
./build/bootstrap/premake_bootstrap embed
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake
$(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)

windows-base: $(SRC)
$(SILENT) if exist .\bin rmdir /s /q .\bin
Expand Down
5 changes: 5 additions & 0 deletions contrib/curl/lib/curl_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
# include "config-linux.h"
#endif

#if defined(__sun__) && defined(__svr4__)
# include "config-linux.h"
# undef HAVE_IOCTL_SIOCGIFADDR
#endif

#ifdef __APPLE__ && __MACH__
# include "config-osx.h"
#endif
Expand Down
3 changes: 2 additions & 1 deletion contrib/curl/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ project "curl-lib"
filter { "system:not windows", "system:not macosx" }
defines { "USE_MBEDTLS" }

filter { "system:linux or bsd" }
filter { "system:linux or bsd or solaris" }
defines { "CURL_HIDDEN_SYMBOLS" }

-- find the location of the ca bundle
Expand All @@ -37,6 +37,7 @@ project "curl-lib"
"/usr/share/ssl/certs/ca-bundle.crt",
"/usr/local/share/certs/ca-root.crt",
"/usr/local/share/certs/ca-root-nss.crt",
"/etc/certs/ca-certificates.crt",
"/etc/ssl/cert.pem" } do
if os.isfile(f) then
ca = f
Expand Down
2 changes: 1 addition & 1 deletion contrib/libzip/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ project "zip-lib"
"**.c"
}

filter "system:linux or bsd"
filter "system:linux or bsd or solaris"
defines { "HAVE_SSIZE_T_LIBZIP", "HAVE_CONFIG_H" }

filter "system:windows"
Expand Down
2 changes: 1 addition & 1 deletion contrib/lua/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ project "lua-lib"
"etc/*.c"
}

filter "system:linux or bsd or hurd or aix"
filter "system:linux or bsd or hurd or aix or solaris"
defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }

filter "system:macosx"
Expand Down
2 changes: 1 addition & 1 deletion modules/codelite/tests/test_codelite_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ cmd2</StartupCommands>
]]
end

function suite.OnProject_PreBuild()
function suite.OnProject_PostBuild()
postbuildcommands { "cmd0", "cmd1" }
prepare()
codelite.project.postBuild(prj)
Expand Down
6 changes: 3 additions & 3 deletions modules/gmake/tests/cpp/test_make_linking.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
]]
Expand All @@ -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" }

Expand Down Expand Up @@ -260,7 +260,7 @@
-- is stripped
--

function suite.onExternalLibraryWithPath()
function suite.onExternalLibraryWithPathAndVersion()
location "MyProject"
links { "libs/SomeLib-1.1" }
prepare { "libs", }
Expand Down
2 changes: 1 addition & 1 deletion modules/gmake/tests/test_make_tovar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
-- Remove parenthesis.
--

function suite.removesDashes()
function suite.removesParenthesis()
test.isequal("MyProject_x86", make.tovar("MyProject (x86)"))
end
4 changes: 2 additions & 2 deletions modules/gmake/tests/workspace/test_config_maps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 [[
Expand All @@ -65,7 +65,7 @@ endif
-- no mapping should be created.
--

function suite.passesThroughConfigs_onNoMap()
function suite.passesThroughConfigs_onNoMapRemovedConfiguration()
removeconfigurations { "Debug" }
prepare()
test.capture [[
Expand Down
6 changes: 3 additions & 3 deletions modules/gmake2/tests/test_gmake2_linking.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
]]
Expand All @@ -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" }

Expand Down Expand Up @@ -262,7 +262,7 @@ LIBS += -lSomeLib
-- is stripped
--

function suite.onExternalLibraryWithPath()
function suite.onExternalLibraryWithPathAndVersion()
location "MyProject"
links { "libs/SomeLib-1.1" }
prepare { "libs", }
Expand Down
2 changes: 2 additions & 0 deletions modules/self-test/self-test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion modules/self-test/test_declare.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion modules/self-test/test_runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@
if ok then
return 1, 0
else
m.print(string.format("%s.%s: %s", test.suiteName, test.testName, err))
term.pushColor(term.warningColor)
io.write(string.format("%s.%s", test.suiteName, test.testName))
term.popColor()
m.print(string.format(": %s", err))
return 0, 1
end
end
Expand Down
2 changes: 1 addition & 1 deletion modules/vstudio/tests/vc200x/test_debug_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Environment="key=value&#x0A;foo=bar"
-- flag is set.
--

function suite.environmentVarsSet_onDebugEnvs()
function suite.environmentVarsSet_onDebugEnvsAndDebugEnvsDontMerge()
debugenvs { "key=value" }
flags { "DebugEnvsDontMerge" }
prepare()
Expand Down
107 changes: 68 additions & 39 deletions modules/vstudio/tests/vc2010/test_compile_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -477,16 +477,39 @@
]]
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 [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat></DebugInformationFormat>
<Optimization>Disabled</Optimization>
]]
end


--
-- VS2015 and newer can use DebugInformationFormat None.
--
function suite.onNoSymbolsVS2015()
symbols 'Off'
p.action.set("vs2015")
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>None</DebugInformationFormat>
<Optimization>Disabled</Optimization>
</ClCompile>
]]
end

Expand Down Expand Up @@ -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 [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat></DebugInformationFormat>
<Optimization>Disabled</Optimization>
]]
end


--
-- VS2015 and newer can use DebugInformationFormat None.
--
function suite.onNoSymbolsVS2015()
symbols 'Off'
p.action.set("vs2015")
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>None</DebugInformationFormat>
<Optimization>Disabled</Optimization>
]]
end


--
-- Check handling of the stringpooling api
--
Expand Down Expand Up @@ -1179,6 +1166,48 @@
cppdialect 'C++17'
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
]]
end

function suite.onLanguage_CppLatest_VS2010()
cppdialect 'C++latest'
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
</ClCompile>
]]
end

function suite.onLanguage_CppLatest_VS2015()
p.action.set("vs2015")

cppdialect 'C++latest'
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalOptions>/std:c++latest %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
]]
end

function suite.onLanguage_CppLatest_VS2017()
p.action.set("vs2017")

cppdialect 'C++latest'
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
Expand Down
2 changes: 1 addition & 1 deletion modules/vstudio/tests/vc2010/test_debug_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 [[
Expand Down
2 changes: 1 addition & 1 deletion modules/vstudio/tests/vc2010/test_filters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
--
-- Check handling of .asm files
--
function suite.itemGroup_onNoneSection()
function suite.itemGroup_onMasmSection()
files { "hello.asm" }
prepare()
test.capture [[
Expand Down
2 changes: 1 addition & 1 deletion modules/vstudio/tests/vc2010/test_imagexex_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
--
-- Ensure configuration file is output in ImageXex block
--
function suite.defaultSettings()
function suite.onConfigfile()
configfile "testconfig.xml"
prepare()
test.capture [[
Expand Down
2 changes: 1 addition & 1 deletion modules/vstudio/tests/vc2010/test_link.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 [[
Expand Down
2 changes: 1 addition & 1 deletion modules/vstudio/tests/vc2010/test_project_refs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading

0 comments on commit 9921fc6

Please sign in to comment.