From 0333f2eca72dfa464a71033363bfd15773718b48 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 2 Apr 2025 21:54:55 +0200 Subject: WIP --- test/suite/test.bat | 10 ++++++++++ test/suite/test.cc | 5 +++++ test/suite/test.sh | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 test/suite/test.bat (limited to 'test/suite') diff --git a/test/suite/test.bat b/test/suite/test.bat new file mode 100644 index 0000000..b6b2750 --- /dev/null +++ b/test/suite/test.bat @@ -0,0 +1,10 @@ +@echo off + +set CXX=cl.exe +set CTORDIR=..\..\build + +%CXX% /nologo /MT /std:c++20 /D_X86_ /EHsc test.cc /link /out:test.exe +@if %errorlevel% neq 0 exit /b %errorlevel% + +test.exe +@if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/test/suite/test.cc b/test/suite/test.cc index b9a6cc3..2494f02 100644 --- a/test/suite/test.cc +++ b/test/suite/test.cc @@ -64,8 +64,13 @@ int main() // Compile bootstrap binary std::vector args = +#if _MSC_VER && !__INTEL_COMPILER + {"/nologo", "/MT", "/std:c++20", "/D_X86_", "/EHsc", "/I..\\..\\src", + "ctor.cc", "/link", "/LIBPATH:"+CTORDIR, "libctor.lib", "/out:ctor.exe"}; +#else {"-pthread", "-std=c++20", "-L", CTORDIR, "-lctor", "-I", "../../src", "ctor.cc", "-o", "ctor"}; +#endif // TODO: add support for quoted strings with spaces if(!CXXFLAGS.empty()) diff --git a/test/suite/test.sh b/test/suite/test.sh index 4638c0d..8272247 100755 --- a/test/suite/test.sh +++ b/test/suite/test.sh @@ -1,4 +1,6 @@ #!/bin/bash +#set -x + : ${CXX:=g++} $CXX $LDFLAGS $CXXFLAGS -std=c++20 -Wall test.cc -o test && ./test -- cgit v1.2.3