Skip to content

Commit 205c693

Browse files
committed
sync tests in :cmdTests subroutine with shell script
1 parent d789e52 commit 205c693

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

project/scripts/build.bat

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ set _TESTS_POS_DIR=%_ROOT_DIR%test\pos
2424

2525
set _SOURCE=tests/pos/HelloWorld.scala
2626
set _MAIN=HelloWorld
27+
set _TASTY=HelloWorld.tasty
2728
set _EXPECTED_OUTPUT=hello world
2829

2930
call :args %*
@@ -142,16 +143,16 @@ echo -timer display total execution time
142143
echo -verbose display environment settings
143144
echo Subcommands:
144145
echo arch[ives] generate gz/zip archives (after bootstrap)
145-
echo boot[strap] generate compiler bootstrap (after compile)
146+
echo boot[strap] generate+test bootstrapped compiler (after compile)
146147
echo cleanall clean project (sbt+git) and quit
147148
echo clone update submodules
148-
echo compile generate compiler 1st stage (after clone)
149+
echo compile generate+test 1st stage compiler (after clone)
149150
echo doc[umentation] generate documentation (after bootstrap)
150151
echo help display this help message
151152
echo Advanced subcommands (no deps):
152153
echo arch[ives]-only generate ONLY gz/zip archives
153-
echo boot[strap]-only generate ONLY compiler bootstrap
154-
echo compile-only generate ONLY compiler 1st stage
154+
echo boot[strap]-only generate+test ONLY bootstrapped compiler
155+
echo compile-only generate+test ONLY 1st stage compiler
155156
echo doc[umentation]-only] generate ONLY documentation
156157

157158
goto :eof
@@ -176,11 +177,17 @@ rem full path is required for sbt to run successfully
176177
for /f %%i in ('where sbt.bat') do set _SBT_CMD=%%i
177178

178179
if %_VERBOSE%==1 (
179-
for /f %%i in ('where git.exe') do set _GIT_CMD1=%%i
180-
echo _GIT_CMD=!_GIT_CMD1!
181-
echo _SBT_CMD=%_SBT_CMD%
182-
echo JAVA_OPTS=%JAVA_OPTS%
183-
echo SBT_OPTS=%SBT_OPTS%
180+
for /f %%i in ('where git.exe') do set __GIT_CMD1=%%i
181+
set __GIT_BRANCH=unknown
182+
for /f "tokens=1-4,*" %%f in ('!__GIT_CMD1! branch -vv ^| findstr /b *') do set __GIT_BRANCH=%%g %%i
183+
echo Tool paths
184+
echo GIT_CMD=!__GIT_CMD1!
185+
echo SBT_CMD=%_SBT_CMD%
186+
echo Tool options
187+
echo JAVA_OPTS=%JAVA_OPTS%
188+
echo SBT_OPTS=%SBT_OPTS%
189+
echo Current Git branch
190+
echo !__GIT_BRANCH!
184191
echo.
185192
)
186193
if %_TIMER%==1 (
@@ -262,6 +269,11 @@ call "%_SBT_CMD%" ";dotc -decompile -color:never -classpath %_OUT_DIR% %_MAIN%"
262269
call :grep "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "%_TMP_FILE%"
263270
if not %_EXITCODE%==0 goto :eof
264271

272+
echo testing sbt dotc -decompile from file
273+
call "%_SBT_CMD%" ";dotc -decompile -color:never %_OUT_DIR%\%_TASTY%" > "%_TMP_FILE%"
274+
call :grep "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "%_TMP_FILE%"
275+
if not %_EXITCODE%==0 goto :eof
276+
265277
echo testing sbt dotr with no -classpath
266278
call :clear_out "%_OUT_DIR%"
267279
if %_DEBUG%==1 echo [%_BASENAME%] "%_SBT_CMD%" ";dotc %_SOURCE% ; dotr %_MAIN%" ^> "%_TMP_FILE%"

0 commit comments

Comments
 (0)