mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
Build with Forge v0.0.x
This commit is contained in:
parent
10e50ad70c
commit
8519410c91
4 changed files with 142 additions and 0 deletions
48
UnitTest++/UnitTest++.forge
Normal file
48
UnitTest++/UnitTest++.forge
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
|
||||
for _, forge in forge:builds('cc.*') do
|
||||
local forge = forge:inherit {
|
||||
warning_level = 0;
|
||||
};
|
||||
|
||||
local library = forge:StaticLibrary '${lib}/UnitTest++_${architecture}' {
|
||||
forge:Cxx '${obj}/%1' {
|
||||
'RequiredCheckException.cpp',
|
||||
'RequiredCheckTestReporter.cpp',
|
||||
'CompositeTestReporter.cpp',
|
||||
'Checks.cpp',
|
||||
'TestReporter.cpp',
|
||||
'Test.cpp',
|
||||
'TestRunner.cpp',
|
||||
'ThrowingTestReporter.cpp',
|
||||
'XmlTestReporter.cpp',
|
||||
'TestList.cpp',
|
||||
'DeferredTestReporter.cpp',
|
||||
'DeferredTestResult.cpp',
|
||||
'CurrentTest.cpp',
|
||||
'TestDetails.cpp',
|
||||
'ReportAssert.cpp',
|
||||
'TimeConstraint.cpp',
|
||||
'TestResults.cpp',
|
||||
'MemoryOutStream.cpp',
|
||||
'AssertException.cpp',
|
||||
'TestReporterStdout.cpp'
|
||||
};
|
||||
};
|
||||
|
||||
if forge:platform_matches('windows') then
|
||||
library {
|
||||
forge:Cxx '${obj}/%1' {
|
||||
'Win32/TimeHelpers.cpp'
|
||||
};
|
||||
};
|
||||
end
|
||||
|
||||
if forge:platform_matches('macos') or forge:platform_matches('linux') then
|
||||
library {
|
||||
forge:Cxx '${obj}/%1' {
|
||||
'Posix/SignalTranslator.cpp',
|
||||
'Posix/TimeHelpers.cpp'
|
||||
};
|
||||
};
|
||||
end
|
||||
end
|
||||
56
forge.lua
Normal file
56
forge.lua
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
variant = variant or 'debug';
|
||||
|
||||
local forge = require 'forge.cc' {
|
||||
identifier = 'cc_${platform}_${architecture}';
|
||||
platform = forge:operating_system();
|
||||
bin = forge:root( ('%s/bin'):format(variant) );
|
||||
lib = forge:root( ('%s/lib'):format(variant) );
|
||||
obj = forge:root( ('%s/obj'):format(variant) );
|
||||
include_directories = {
|
||||
forge:root();
|
||||
};
|
||||
library_directories = {
|
||||
forge:root( ('%s/lib'):format(variant) );
|
||||
};
|
||||
visual_studio = {
|
||||
sln = forge:root( 'unittest-cpp.sln' );
|
||||
};
|
||||
xcode = {
|
||||
xcodeproj = forge:root( 'unittest-cpp.xcodeproj' );
|
||||
};
|
||||
|
||||
architecture = 'x86_64';
|
||||
assertions = variant ~= 'shipping';
|
||||
debug = variant ~= 'shipping';
|
||||
debuggable = variant ~= 'shipping';
|
||||
exceptions = true;
|
||||
fast_floating_point = variant ~= 'debug';
|
||||
incremental_linking = variant == 'debug';
|
||||
link_time_code_generation = variant == 'shipping';
|
||||
minimal_rebuild = variant == 'debug';
|
||||
optimization = variant ~= 'debug';
|
||||
run_time_checks = variant == 'debug';
|
||||
runtime_library = variant == 'debug' and 'static_debug' or 'static_release';
|
||||
run_time_type_info = true;
|
||||
stack_size = 1048576;
|
||||
standard = 'c++11';
|
||||
string_pooling = variant == 'shipping';
|
||||
strip = false;
|
||||
warning_level = 3;
|
||||
warnings_as_errors = true;
|
||||
};
|
||||
|
||||
-- Bump the C++ standard to c++14 when building on Windows as that is the
|
||||
-- closest standard supported by Microsoft Visual C++.
|
||||
local settings = forge.settings;
|
||||
if settings.platform == 'windows' then
|
||||
settings.standard = 'c++14';
|
||||
end
|
||||
|
||||
buildfile 'unittest-cpp.forge';
|
||||
|
||||
forge:all {
|
||||
'tests/all',
|
||||
'UnitTest++/all'
|
||||
};
|
||||
35
tests/tests.forge
Normal file
35
tests/tests.forge
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
local forge = forge:build('cc.*'):inherit {
|
||||
warning_level = 0;
|
||||
}
|
||||
|
||||
forge:all {
|
||||
forge:Executable '${bin}/TestUnitTest++' {
|
||||
'${lib}/UnitTest++_${architecture}';
|
||||
|
||||
forge:Cxx '${obj}/%1' {
|
||||
'Main.cpp',
|
||||
'TestAssertHandler.cpp',
|
||||
'TestCheckMacros.cpp',
|
||||
'TestChecks.cpp',
|
||||
'TestCompositeTestReporter.cpp',
|
||||
'TestCurrentTest.cpp',
|
||||
'TestDeferredTestReporter.cpp',
|
||||
'TestExceptions.cpp',
|
||||
'TestLongMacros.cpp',
|
||||
'TestMemoryOutStream.cpp',
|
||||
'TestRequireMacrosWithExceptionsOff.cpp',
|
||||
'TestRequireMacrosWithExceptionsOn.cpp',
|
||||
'TestTest.cpp',
|
||||
'TestTestList.cpp',
|
||||
'TestTestMacros.cpp',
|
||||
'TestTestResults.cpp',
|
||||
'TestTestRunner.cpp',
|
||||
'TestTestSuite.cpp',
|
||||
'TestTimeConstraint.cpp',
|
||||
'TestTimeConstraintMacro.cpp',
|
||||
'TestUnitTestPP.cpp',
|
||||
'TestXmlTestReporter.cpp'
|
||||
};
|
||||
};
|
||||
};
|
||||
3
unittest-cpp.forge
Normal file
3
unittest-cpp.forge
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
buildfile "tests/tests.forge";
|
||||
buildfile 'UnitTest++/UnitTest++.forge';
|
||||
Loading…
Add table
Add a link
Reference in a new issue