This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/modules/android/tests/test_android_project.lua
Sam Surtees f7626d4e2a Add 'modules/android/' from premake-android
- Additional changes to get tests working
2018-04-05 20:58:31 +10:00

115 lines
2.5 KiB
Lua

local p = premake
local suite = test.declare("test_android_project")
local vc2010 = p.vstudio.vc2010
--
-- Setup
--
local wks, prj
function suite.setup()
p.action.set("vs2015")
wks, prj = test.createWorkspace()
end
local function prepare()
system "android"
local cfg = test.getconfig(prj, "Debug", platform)
vc2010.clCompile(cfg)
end
function suite.noOptions()
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
</ClCompile>]]
end
function suite.rttiOff()
rtti "Off"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<ExceptionHandling>Enabled</ExceptionHandling>
</ClCompile>]]
end
function suite.rttiOn()
rtti "On"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
]]
end
function suite.exceptionHandlingOff()
exceptionhandling "Off"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
</ClCompile>]]
end
function suite.exceptionHandlingOn()
exceptionhandling "On"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
]]
end
function suite.cppdialect_cpp11()
cppdialect "C++11"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<CppLanguageStandard>c++11</CppLanguageStandard>
]]
end
function suite.cppdialect_cpp14()
cppdialect "C++14"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<CppLanguageStandard>c++1y</CppLanguageStandard>
]]
end
function suite.cppdialect_cpp17()
cppdialect "C++17"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<AdditionalOptions>-std=c++1z %(AdditionalOptions)</AdditionalOptions>
]]
end