|
|
@@ -45,25 +45,26 @@ void check_tc_compile(std::string_view tc_content, |
|
|
|
|
|
|
|
TEST_CASE("Generating toolchain commands") { |
|
|
|
check_tc_compile("Compiler-ID: GNU", |
|
|
|
"g++ -fPIC -fdiagnostics-color -pthread -MD -MF foo.o.d -c foo.cpp -ofoo.o", |
|
|
|
"g++ -fPIC -fdiagnostics-color -pthread -MD -MF foo.o.d -MT foo.o -c foo.cpp -ofoo.o", |
|
|
|
"g++ -fPIC -fdiagnostics-color -pthread -Wall -Wextra -Wpedantic -Wconversion " |
|
|
|
"-MD -MF foo.o.d -c foo.cpp -ofoo.o", |
|
|
|
"-MD -MF foo.o.d -MT foo.o -c foo.cpp -ofoo.o", |
|
|
|
"ar rcs stuff.a foo.o bar.o", |
|
|
|
"g++ -fPIC -fdiagnostics-color foo.o bar.a -pthread -lstdc++fs -omeow.exe"); |
|
|
|
|
|
|
|
check_tc_compile( |
|
|
|
"Compiler-ID: GNU\nDebug: True", |
|
|
|
"g++ -g -fPIC -fdiagnostics-color -pthread -MD -MF foo.o.d -c foo.cpp -ofoo.o", |
|
|
|
"g++ -g -fPIC -fdiagnostics-color -pthread -MD -MF foo.o.d -MT foo.o -c foo.cpp -ofoo.o", |
|
|
|
"g++ -g -fPIC -fdiagnostics-color -pthread -Wall -Wextra -Wpedantic -Wconversion " |
|
|
|
"-MD -MF foo.o.d -c foo.cpp -ofoo.o", |
|
|
|
"-MD -MF foo.o.d -MT foo.o -c foo.cpp -ofoo.o", |
|
|
|
"ar rcs stuff.a foo.o bar.o", |
|
|
|
"g++ -fPIC -fdiagnostics-color foo.o bar.a -pthread -lstdc++fs -omeow.exe -g"); |
|
|
|
|
|
|
|
check_tc_compile( |
|
|
|
"Compiler-ID: GNU\nDebug: True\nOptimize: True", |
|
|
|
"g++ -O2 -g -fPIC -fdiagnostics-color -pthread -MD -MF foo.o.d -c foo.cpp -ofoo.o", |
|
|
|
"g++ -O2 -g -fPIC -fdiagnostics-color -pthread -MD -MF foo.o.d -MT foo.o -c foo.cpp " |
|
|
|
"-ofoo.o", |
|
|
|
"g++ -O2 -g -fPIC -fdiagnostics-color -pthread -Wall -Wextra -Wpedantic -Wconversion " |
|
|
|
"-MD -MF foo.o.d -c foo.cpp -ofoo.o", |
|
|
|
"-MD -MF foo.o.d -MT foo.o -c foo.cpp -ofoo.o", |
|
|
|
"ar rcs stuff.a foo.o bar.o", |
|
|
|
"g++ -fPIC -fdiagnostics-color foo.o bar.a -pthread -lstdc++fs -omeow.exe -O2 -g"); |
|
|
|
|
|
|
@@ -73,11 +74,12 @@ TEST_CASE("Generating toolchain commands") { |
|
|
|
"lib /nologo /OUT:stuff.a foo.o bar.o", |
|
|
|
"cl.exe /nologo /EHsc foo.o bar.a /Femeow.exe /MT"); |
|
|
|
|
|
|
|
check_tc_compile("Compiler-ID: MSVC\nDebug: True", |
|
|
|
"cl.exe /Z7 /DEBUG /MTd /EHsc /nologo /permissive- /showIncludes /c foo.cpp /Fofoo.o", |
|
|
|
"cl.exe /Z7 /DEBUG /MTd /EHsc /nologo /permissive- /W4 /showIncludes /c foo.cpp /Fofoo.o", |
|
|
|
"lib /nologo /OUT:stuff.a foo.o bar.o", |
|
|
|
"cl.exe /nologo /EHsc foo.o bar.a /Femeow.exe /Z7 /DEBUG /MTd"); |
|
|
|
check_tc_compile( |
|
|
|
"Compiler-ID: MSVC\nDebug: True", |
|
|
|
"cl.exe /Z7 /DEBUG /MTd /EHsc /nologo /permissive- /showIncludes /c foo.cpp /Fofoo.o", |
|
|
|
"cl.exe /Z7 /DEBUG /MTd /EHsc /nologo /permissive- /W4 /showIncludes /c foo.cpp /Fofoo.o", |
|
|
|
"lib /nologo /OUT:stuff.a foo.o bar.o", |
|
|
|
"cl.exe /nologo /EHsc foo.o bar.a /Femeow.exe /Z7 /DEBUG /MTd"); |
|
|
|
|
|
|
|
auto tc = dds::parse_toolchain_dds(R"( |
|
|
|
Compiler-ID: GNU |
|
|
@@ -95,6 +97,8 @@ TEST_CASE("Generating toolchain commands") { |
|
|
|
"-MD", |
|
|
|
"-MF", |
|
|
|
"foo.o.d", |
|
|
|
"-MT", |
|
|
|
"foo.o", |
|
|
|
"-c", |
|
|
|
"foo.cpp", |
|
|
|
"-ofoo.o"}); |
|
|
@@ -111,6 +115,8 @@ TEST_CASE("Generating toolchain commands") { |
|
|
|
"-MD", |
|
|
|
"-MF", |
|
|
|
"foo.o.d", |
|
|
|
"-MT", |
|
|
|
"foo.o", |
|
|
|
"-c", |
|
|
|
"foo.cpp", |
|
|
|
"-ofoo.o"}); |
|
|
@@ -129,6 +135,8 @@ TEST_CASE("Generating toolchain commands") { |
|
|
|
"-MD", |
|
|
|
"-MF", |
|
|
|
"foo.o.d", |
|
|
|
"-MT", |
|
|
|
"foo.o", |
|
|
|
"-c", |
|
|
|
"foo.cpp", |
|
|
|
"-ofoo.o"}); |