Skip to content

Commit b1af46c

Browse files
committed
added missing ERRORLEVEL tests
1 parent 654eb22 commit b1af46c

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

project/scripts/bootstrapCmdTests.bat

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@ call "%_SBT_CMD%" "dotty-bench/jmh:run 1 1 tests/pos/alias.scala"
3434
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
3535

3636
rem # The above is here as it relies on the bootstrapped library.
37+
if %_DEBUG%==1 echo [%_BASENAME%] call "%_SBT_CMD%" "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
3738
call "%_SBT_CMD%" "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
39+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
40+
if %_DEBUG%==1 echo [%_BASENAME%] call "%_SBT_CMD%" "dotty-bench-bootstrapped/jmh:run 1 1 -with-compiler compiler/src/dotty/tools/dotc/core/Types.scala"
3841
call "%_SBT_CMD%" "dotty-bench-bootstrapped/jmh:run 1 1 -with-compiler compiler/src/dotty/tools/dotc/core/Types.scala"
42+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
3943

4044
echo testing scala.quoted.Expr.run from sbt dotr
45+
if %_DEBUG%==1 echo [%_BASENAME%] call "%_SBT_CMD%" ";dotty-compiler-bootstrapped/dotc tests/run-with-compiler/quote-run.scala; dotty-compiler-bootstrapped/dotr -with-compiler Test" ^> "%_TMP_FILE%"
4146
call "%_SBT_CMD%" ";dotty-compiler-bootstrapped/dotc tests/run-with-compiler/quote-run.scala; dotty-compiler-bootstrapped/dotr -with-compiler Test" > "%_TMP_FILE%"
47+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
4248
call :grep "val a: scala.Int = 3" "%_TMP_FILE%"
4349
if not %_EXITCODE%==0 goto end
4450

@@ -52,8 +58,10 @@ echo testing ./bin/dotc and ./bin/dotr
5258
call :clear_out "%_OUT_DIR%"
5359
if %_DEBUG%==1 echo [%_BASENAME%] call %_BIN_DIR%\dotc.bat "%_SOURCE%" -d "%_OUT_DIR%"
5460
call %_BIN_DIR%\dotc.bat "%_SOURCE%" -d "%_OUT_DIR%"
61+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
5562
if %_DEBUG%==1 echo [%_BASENAME%] call %_BIN_DIR%\dotr.bat -classpath "%_OUT_DIR%" "%_MAIN%" ^> "%_TMP_FILE%"
5663
call %_BIN_DIR%\dotr.bat -classpath "%_OUT_DIR%" "%_MAIN%" > "%_TMP_FILE%"
64+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
5765
if %_DEBUG%==1 echo [%_BASENAME%] call :test_pattern "%_EXPECTED_OUTPUT%" "%_TMP_FILE%"
5866
call :test_pattern "%_EXPECTED_OUTPUT%" "%_TMP_FILE%"
5967
if not %_EXITCODE%==0 goto end
@@ -63,14 +71,14 @@ echo testing ./bin/dotc -from-tasty and dotr -classpath
6371
call :clear_out "%_OUT1_DIR%"
6472
if %_DEBUG%==1 echo [%_BASENAME%] call %_BIN_DIR%\dotc.bat -from-tasty -classpath "%_OUT_DIR%" -d "%_OUT1_DIR%" "%_MAIN%"
6573
call %_BIN_DIR%\dotc.bat -from-tasty -classpath "%_OUT_DIR%" -d "%_OUT1_DIR%" "%_MAIN%"
74+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
6675
if %_DEBUG%==1 echo [%_BASENAME%] call %_BIN_DIR%\dotr.bat -classpath "%_OUT1_DIR%" "%_MAIN%" ^> "%_TMP_FILE%"
6776
call %_BIN_DIR%\dotr.bat -classpath "%_OUT1_DIR%" "%_MAIN%" > "%_TMP_FILE%"
77+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
6878
if %_DEBUG%==1 echo [%_BASENAME%] call :test_pattern "%_EXPECTED_OUTPUT%" "%_TMP_FILE%"
6979
call :test_pattern "%_EXPECTED_OUTPUT%" "%_TMP_FILE%"
7080
if not %_EXITCODE%==0 goto end
7181

72-
rem # echo ":quit" | ./dist-bootstrapped/target/pack/bin/dotr # not supported by CI
73-
7482
echo testing ./bin/dotd
7583
call :clear_out "%_OUT_DIR%"
7684
if %_DEBUG%==1 echo [%_BASENAME%] call %_BIN_DIR%\dotd.bat -project Hello -siteroot "%_OUT_DIR%" "%_SOURCE%"

project/scripts/cmdTests.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,47 @@ rem ## Main
3030
echo testing sbt dotc and dotr
3131
if %_DEBUG%==1 echo [%_BASENAME%] "%_SBT_CMD%" ";dotc %_SOURCE% -d %_OUT_DIR% ;dotr -classpath %_OUT_DIR% %_MAIN%" ^> "%_TMP_FILE%"
3232
call "%_SBT_CMD%" ";dotc %_SOURCE% -d %_OUT_DIR% ;dotr -classpath %_OUT_DIR% %_MAIN%" > "%_TMP_FILE%"
33+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
3334
call :grep "%_EXPECTED_OUTPUT%" "%_TMP_FILE%"
3435
if not %_EXITCODE%==0 goto end
3536

3637
rem # check that `sbt dotc` compiles and `sbt dotr` runs it
3738
echo testing sbt dotc -from-tasty and dotr -classpath
3839
call :clear_out "%_OUT_DIR%"
40+
if %_DEBUG%==1 echo [%_BASENAME%] call "%_SBT_CMD%" ";dotc %_SOURCE% -d %_OUT_DIR% ;dotc -from-tasty -classpath %_OUT_DIR% -d %_OUT1_DIR% %_MAIN% ;dotr -classpath %_OUT1_DIR% %_MAIN%" ^> "%_TMP_FILE%"
3941
call "%_SBT_CMD%" ";dotc %_SOURCE% -d %_OUT_DIR% ;dotc -from-tasty -classpath %_OUT_DIR% -d %_OUT1_DIR% %_MAIN% ;dotr -classpath %_OUT1_DIR% %_MAIN%" > "%_TMP_FILE%"
42+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
4043
call :grep "%_EXPECTED_OUTPUT%" "%_TMP_FILE%"
4144
if not %_EXITCODE%==0 goto end
4245

4346
rem # check that `sbt dotc -decompile` runs
4447
echo testing sbt dotc -decompile
48+
if %_DEBUG%==1 echo [%_BASENAME%] call "%_SBT_CMD%" ";dotc -decompile -color:never -classpath %_OUT_DIR% %_MAIN%" ^> "%_TMP_FILE%"
4549
call "%_SBT_CMD%" ";dotc -decompile -color:never -classpath %_OUT_DIR% %_MAIN%" > "%_TMP_FILE%"
50+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
4651
call :grep "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "%_TMP_FILE%"
4752
if not %_EXITCODE%==0 goto end
4853

4954
echo testing sbt dotc -decompile from file
55+
if %_DEBUG%==1 echo [%_BASENAME%] call "%_SBT_CMD%" ";dotc -decompile -color:never %_OUT_DIR%\%_TASTY%" ^> "%_TMP_FILE%"
5056
call "%_SBT_CMD%" ";dotc -decompile -color:never %_OUT_DIR%\%_TASTY%" > "%_TMP_FILE%"
57+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
5158
call :grep "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "%_TMP_FILE%"
5259
if not %_EXITCODE%==0 goto end
5360

5461
echo testing sbt dotr with no -classpath
5562
call :clear_out "%_OUT_DIR%"
5663
if %_DEBUG%==1 echo [%_BASENAME%] "%_SBT_CMD%" ";dotc %_SOURCE% ; dotr %_MAIN%" ^> "%_TMP_FILE%"
5764
call "%_SBT_CMD%" ";dotc %_SOURCE% ; dotr %_MAIN%" > "%_TMP_FILE%"
65+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
5866
call :grep "%_EXPECTED_OUTPUT%" "%_TMP_FILE%"
5967
if not %_EXITCODE%==0 goto end
6068

6169
echo testing loading tasty from .tasty file in jar
6270
call :clear_out "%_OUT_DIR%"
71+
if %_DEBUG%==1 echo [%_BASENAME%] call "%_SBT_CMD%" ";dotc -d %_OUT_DIR%\out.jar %_SOURCE%; dotc -decompile -classpath %_OUT_DIR%\out.jar -color:never %_MAIN%" ^> "%_TMP_FILE%"
6372
call "%_SBT_CMD%" ";dotc -d %_OUT_DIR%\out.jar %_SOURCE%; dotc -decompile -classpath %_OUT_DIR%\out.jar -color:never %_MAIN%" > "%_TMP_FILE%"
73+
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
6474
call :grep "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "%_TMP_FILE%"
6575
if not %_EXITCODE%==0 goto end
6676

0 commit comments

Comments
 (0)