Skip to content

Commit 9b195b7

Browse files
committed
add explicit tests of scalac flags
1 parent 638f4f8 commit 9b195b7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

project/scripts/bootstrappedOnlyCmdTests

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,26 @@ echo "testing sbt scalac -decompile from file"
4747
./bin/scalac -decompile -color:never "$OUT/$TASTY" > "$tmp"
4848
grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tmp"
4949

50+
# check that `sbt scalac -print-tasty` runs
51+
echo "testing sbt scalac -print-tasty from file"
52+
./bin/scalac -print-tasty -color:never "$OUT/$TASTY" > "$tmp"
53+
grep -qe "118: STRINGconst 32 \[hello world\]" "$tmp"
54+
5055
echo "testing loading tasty from .tasty file in jar"
5156
clear_out "$OUT"
5257
./bin/scalac -d "$OUT/out.jar" "$SOURCE"
5358
./bin/scalac -decompile -color:never "$OUT/out.jar" > "$tmp"
5459
grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tmp"
5560

61+
echo "testing printing tasty from .tasty file in jar"
62+
./bin/scalac -print-tasty -color:never "$OUT/out.jar" > "$tmp"
63+
grep -qe "118: STRINGconst 32 \[hello world\]" "$tmp"
64+
65+
echo "testing -script from scalac"
66+
clear_out "$OUT"
67+
./bin/scalac -script "$SOURCE" > "$tmp"
68+
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"
69+
5670
echo "testing sbt scalac with suspension"
5771
clear_out "$OUT"
5872
"$SBT" "scala3-compiler-bootstrapped/scalac -d $OUT tests/pos-macros/macros-in-same-project-1/Bar.scala tests/pos-macros/macros-in-same-project-1/Foo.scala" > "$tmp"

0 commit comments

Comments
 (0)