@@ -18,28 +18,37 @@ grep -qe "val a: scala.Int = 3" "$tmp"
18
18
# setup for `scalac`/`scala` script tests
19
19
" $SBT " dist/pack
20
20
21
+ echo " capturing scala version from dist/target/pack/VERSION"
22
+ IFS=' :=' read -ra versionProps < " $ROOT /dist/target/pack/VERSION" # temporarily set IFS to ':=' to split versionProps
23
+ [ ${# versionProps[@]} -eq 3 ] && \
24
+ [ ${versionProps[0]} = " version" ] && \
25
+ [ -n ${versionProps[2]} ] || die " Expected non-empty 'version' property in $ROOT /dist/target/pack/VERSION"
26
+ scala_version=${versionProps[2]}
27
+
21
28
# check that `scalac` compiles and `scala` runs it
22
29
echo " testing ./bin/scalac and ./bin/scala"
23
30
clear_out " $OUT "
24
31
./bin/scalac " $SOURCE " -d " $OUT "
25
- ./bin/scala -classpath " $OUT " " $MAIN " > " $tmp "
32
+ ./bin/scala -classpath " $OUT " -M " $MAIN " > " $tmp "
26
33
test " $EXPECTED_OUTPUT " = " $( cat " $tmp " ) "
27
34
28
35
# Test scaladoc based on compiled classes
29
36
./bin/scaladoc -project Staging -d " $OUT1 " " $OUT "
30
37
clear_out " $OUT1 "
31
38
32
- # check that `scalac` and `scala` works for staging
39
+ # check that `scalac` and `scala` works for staging.
40
+ # TODO: scala3-staging should be automatically added by Scala CLI
41
+ # - see: https://github.com/VirtusLab/scala-cli/issues/2879
33
42
clear_out " $OUT "
34
43
./bin/scalac tests/run-staging/i4044f.scala -d " $OUT "
35
- ./bin/scala -with-compiler -classpath " $OUT " Test > " $tmp "
44
+ ./bin/scala -with-compiler -classpath " $OUT " --dep " org.scala-lang::scala3-staging: $scala_version " -M Test > " $tmp "
36
45
37
46
# check that `scalac -from-tasty` compiles and `scala` runs it
38
47
echo " testing ./bin/scalac -from-tasty and scala -classpath"
39
48
clear_out " $OUT1 "
40
49
./bin/scalac " $SOURCE " -d " $OUT "
41
50
./bin/scalac -from-tasty -d " $OUT1 " " $OUT /$TASTY "
42
- ./bin/scala -classpath " $OUT1 " " $MAIN " > " $tmp "
51
+ ./bin/scala -classpath " $OUT1 " -M " $MAIN " > " $tmp "
43
52
test " $EXPECTED_OUTPUT " = " $( cat " $tmp " ) "
44
53
45
54
# check that `sbt scalac -decompile` runs
@@ -90,10 +99,12 @@ clear_out "$OUT"
90
99
./bin/scalac -help > " $tmp " 2>&1
91
100
grep -qe " Usage: scalac <options> <source files>" " $tmp "
92
101
102
+ # TODO: JAVA launcher should be able to override "scala-cli" program name
103
+ # - see: https://github.com/VirtusLab/scala-cli/issues/2838#issuecomment-2085130815
93
104
./bin/scala -help > " $tmp " 2>&1
94
- grep -qe " Usage: scala <options> <source files> " " $tmp "
105
+ grep -qe " See ' scala-cli <command> --help' to read about a specific subcommand. " " $tmp "
95
106
96
- ./bin/scala -d hello.jar tests/run/hello.scala
107
+ ./bin/scala -d hello.jar tests/run/hello.scala --server=false
97
108
ls hello.jar
98
109
99
110
echo " testing i12973"
@@ -102,14 +113,6 @@ clear_out "$OUT"
102
113
echo " Bug12973().check" | TERM=dumb ./bin/scala -cp " $OUT /out.jar" > " $tmp " 2>&1
103
114
grep -qe " Bug12973 is fixed" " $tmp "
104
115
105
- echo " capturing scala version from dist/target/pack/VERSION"
106
- cwd=$( pwd)
107
- IFS=' :=' read -ra versionProps < " $cwd /dist/target/pack/VERSION" # temporarily set IFS to ':=' to split versionProps
108
- [ ${# versionProps[@]} -eq 3 ] && \
109
- [ ${versionProps[0]} = " version" ] && \
110
- [ -n ${versionProps[2]} ] || die " Expected non-empty 'version' property in $cwd /dist/target/pack/VERSION"
111
- scala_version=${versionProps[2]}
112
-
113
116
echo " testing -sourcepath with incremental compile: inlining changed inline def into a def"
114
117
# Here we will test that a changed inline method symbol loaded from the sourcepath (-sourcepath compiler option)
115
118
# will have its `defTree` correctly set when its method body is required for inlining.
0 commit comments