From aefba70c1e311d68a8b7d933dfdd395e6518396b Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 10 Jan 2021 18:02:39 +0100 Subject: [PATCH] =?UTF-8?q?Rework=20once=20again=20how=20to=20detect=20a?= =?UTF-8?q?=20failure=20in=20an=20application:=20=20=20IF=20errorlevel=201?= =?UTF-8?q?=20only=20works=20for=20positive=20error=20code=20=20=20IF=20no?= =?UTF-8?q?t=20errorlevel=200=20only=20works=20for=20negative=20error=20co?= =?UTF-8?q?de=20There=20are=20not=20reliable.=20So,=20use=20&&=20and=20||?= =?UTF-8?q?=C2=A0instead.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove expected failure on test as all tests pass now (and it was broken). --- tests/Make-check-cl.bat | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tests/Make-check-cl.bat b/tests/Make-check-cl.bat index fc7191d4..f924cd5d 100644 --- a/tests/Make-check-cl.bat +++ b/tests/Make-check-cl.bat @@ -39,10 +39,6 @@ SET PATH=%PATH%;%VCINSTALLDIR%\Tools\Llvm\x64\bin REM Remove previous results DEL *.log *.dat -REM List the expected failure (compiler internal error) -set "expectedFailure1=test-msnapshot.c" -set "expectedFailure2=test-none.c" - REM Select compiler to use (either cl or clang-cl) set "compiler=%1" @@ -56,29 +52,24 @@ for %%f in (test-*.c) do ( echo Testing %%f REM Copy the test file as a C++ file as CL.EXE only support C++ file del test.exe - copy %%f test.cpp - if not ERRORLEVEL 0 EXIT /B 1 + copy %%f test.cpp || EXIT /B 1 REM Compile the test suite REM /Zc:preprocessor is mandatory to have a compliant preprocessor REM /Zc:__cplusplus is needed to report the real value of __cplusplus, so that M*LIB uses the C++ atomic, and not its emulation. REM Enable warnings and basic optimization REM Inform M*LIB to use Annex K by defining __STDC_WANT_LIB_EXT1__ echo Compiling %%f with %compiler% - %compiler% /I.. /O2 /W3 /std:c++14 /Zc:__cplusplus /Zc:preprocessor /D__STDC_WANT_LIB_EXT1__ test.cpp > %%f.log 2>&1 - if not ERRORLEVEL 0 ( + %compiler% /I.. /O2 /W3 /std:c++14 /Zc:__cplusplus /Zc:preprocessor /D__STDC_WANT_LIB_EXT1__ test.cpp > %%f.log 2>&1 || ( echo *** BUILD ERROR for %%f *** >> %%f.log type %%f.log - if /i "%%f" NEQ "%expectedFailure1%" if /i "%%f" NEQ "%expectedFailure2%" EXIT /B 1 + EXIT /B 1 ) REM Execute it echo Running %%f - test.exe >> %%f.log 2>&1 - if not ERRORLEVEL 0 ( + test.exe >> %%f.log 2>&1 && echo Test OK for %%f >> %%f.log || ( echo *** RUNTIME ERROR for %%f *** >> %%f.log type %%f.log - if /i "%%f" NEQ "%expectedFailure%" if /i "%%f" NEQ "%expectedFailure2%" EXIT /B 1 - ) ELSE ( - echo Test OK for %%f >> %%f.log + EXIT /B 1 ) type %%f.log )