Rework once again how to detect a failure in an application:
IF errorlevel 1 only works for positive error code IF not errorlevel 0 only works for negative error code There are not reliable. So, use && and || instead. Remove expected failure on test as all tests pass now (and it was broken).
This commit is contained in:
1 parent
c9ed4ba820
commit
aefba70c1e
1 file changed
+5
-14
+5
-14
@@ -39,10 +39,6 @@ SET PATH=%PATH%;%VCINSTALLDIR%\Tools\Llvm\x64\bin
|
|||||||
REM Remove previous results
|
REM Remove previous results
|
||||||
DEL *.log *.dat
|
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)
|
REM Select compiler to use (either cl or clang-cl)
|
||||||
set "compiler=%1"
|
set "compiler=%1"
|
||||||
|
|
||||||
@@ -56,29 +52,24 @@ for %%f in (test-*.c) do (
|
|||||||
echo Testing %%f
|
echo Testing %%f
|
||||||
REM Copy the test file as a C++ file as CL.EXE only support C++ file
|
REM Copy the test file as a C++ file as CL.EXE only support C++ file
|
||||||
del test.exe
|
del test.exe
|
||||||
copy %%f test.cpp
|
copy %%f test.cpp || EXIT /B 1
|
||||||
if not ERRORLEVEL 0 EXIT /B 1
|
|
||||||
REM Compile the test suite
|
REM Compile the test suite
|
||||||
REM /Zc:preprocessor is mandatory to have a compliant preprocessor
|
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 /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 Enable warnings and basic optimization
|
||||||
REM Inform M*LIB to use Annex K by defining __STDC_WANT_LIB_EXT1__
|
REM Inform M*LIB to use Annex K by defining __STDC_WANT_LIB_EXT1__
|
||||||
echo Compiling %%f with %compiler%
|
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
|
%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 (
|
|
||||||
echo *** BUILD ERROR for %%f *** >> %%f.log
|
echo *** BUILD ERROR for %%f *** >> %%f.log
|
||||||
type %%f.log
|
type %%f.log
|
||||||
if /i "%%f" NEQ "%expectedFailure1%" if /i "%%f" NEQ "%expectedFailure2%" EXIT /B 1
|
EXIT /B 1
|
||||||
)
|
)
|
||||||
REM Execute it
|
REM Execute it
|
||||||
echo Running %%f
|
echo Running %%f
|
||||||
test.exe >> %%f.log 2>&1
|
test.exe >> %%f.log 2>&1 && echo Test OK for %%f >> %%f.log || (
|
||||||
if not ERRORLEVEL 0 (
|
|
||||||
echo *** RUNTIME ERROR for %%f *** >> %%f.log
|
echo *** RUNTIME ERROR for %%f *** >> %%f.log
|
||||||
type %%f.log
|
type %%f.log
|
||||||
if /i "%%f" NEQ "%expectedFailure%" if /i "%%f" NEQ "%expectedFailure2%" EXIT /B 1
|
EXIT /B 1
|
||||||
) ELSE (
|
|
||||||
echo Test OK for %%f >> %%f.log
|
|
||||||
)
|
)
|
||||||
type %%f.log
|
type %%f.log
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user