Skip to content

Commit f22497b

Browse files
authored
Merge pull request #5025 from dotty-staging/fix-bench-no-bootstrap-on-nonbootstrap
Don't bootstrap on non-bootstrap CI job
2 parents 13487ca + 7b27deb commit f22497b

File tree

4 files changed

+57
-51
lines changed

4 files changed

+57
-51
lines changed

.drone.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pipeline:
3535
commands:
3636
- cp -R . /tmp/2/ && cd /tmp/2/
3737
- ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test"
38+
- ./project/scripts/bootstrapCmdTests
3839

3940
test_sbt:
4041
group: test

project/scripts/bootstrapCmdTests

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
source $(dirname $0)/cmdTestsCommon.inc.sh
4+
5+
# check that benchmarks can run
6+
"$SBT" "dotty-bench/jmh:run 1 1 tests/pos/alias.scala"
7+
# The above is here as it relies on the bootstrapped library.
8+
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
9+
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 -with-compiler compiler/src/dotty/tools/dotc/core/Types.scala"
10+
11+
echo "testing scala.quoted.Expr.run from sbt dotr"
12+
"$SBT" ";dotty-compiler-bootstrapped/dotc tests/run-with-compiler/quote-run.scala; dotty-compiler-bootstrapped/dotr -with-compiler Test" > "$tmp"
13+
grep -qe "val a: scala.Int = 3" "$tmp"
14+
15+
16+
# setup for `dotc`/`dotr` script tests
17+
"$SBT" dist-bootstrapped/pack
18+
19+
# check that `dotc` compiles and `dotr` runs it
20+
echo "testing ./bin/dotc and ./bin/dotr"
21+
clear_out "$OUT"
22+
./bin/dotc "$SOURCE" -d "$OUT"
23+
./bin/dotr -classpath "$OUT" "$MAIN" > "$tmp"
24+
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"
25+
26+
# check that `dotc -from-tasty` compiles and `dotr` runs it
27+
echo "testing ./bin/dotc -from-tasty and dotr -classpath"
28+
clear_out "$OUT1"
29+
./bin/dotc -from-tasty -classpath "$OUT" -d "$OUT1" "$MAIN"
30+
./bin/dotr -classpath "$OUT1" "$MAIN" > "$tmp"
31+
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"
32+
33+
# echo ":quit" | ./dist-bootstrapped/target/pack/bin/dotr # not supported by CI
34+
35+
echo "testing ./bin/dotd"
36+
clear_out "$OUT"
37+
./bin/dotd -project Hello -siteroot "$OUT" "$SOURCE"

project/scripts/cmdTests

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -eux
4-
5-
SBT="./project/scripts/sbt" # if run on CI
6-
# SBT="sbt" # if run locally
7-
8-
SOURCE="tests/pos/HelloWorld.scala"
9-
MAIN="HelloWorld"
10-
EXPECTED_OUTPUT="hello world"
11-
12-
# check that benchmarks can run
13-
"$SBT" "dotty-bench/jmh:run 1 1 tests/pos/alias.scala"
14-
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
15-
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 -with-compiler compiler/src/dotty/tools/dotc/core/Types.scala"
16-
17-
OUT=$(mktemp -d)
18-
OUT1=$(mktemp -d)
19-
tmp=$(mktemp)
20-
21-
clear_out()
22-
{
23-
local out="$1"
24-
rm -rf "$out/*"
25-
}
3+
source $(dirname $0)/cmdTestsCommon.inc.sh
264

275
# check that `sbt dotc` compiles and `sbt dotr` runs it
286
echo "testing sbt dotc and dotr"
@@ -50,34 +28,6 @@ clear_out "$OUT"
5028
"$SBT" ";dotc -d $OUT/out.jar $SOURCE; dotc -decompile -classpath $OUT/out.jar -color:never $MAIN" > "$tmp"
5129
grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tmp"
5230

53-
echo "testing scala.quoted.Expr.run from sbt dotr"
54-
"$SBT" ";dotty-compiler-bootstrapped/dotc tests/run-with-compiler/quote-run.scala; dotty-compiler-bootstrapped/dotr -with-compiler Test" > "$tmp"
55-
grep -qe "val a: scala.Int = 3" "$tmp"
56-
57-
58-
# setup for `dotc`/`dotr` script tests
59-
"$SBT" dist-bootstrapped/pack
60-
61-
# check that `dotc` compiles and `dotr` runs it
62-
echo "testing ./bin/dotc and ./bin/dotr"
63-
clear_out "$OUT"
64-
./bin/dotc "$SOURCE" -d "$OUT"
65-
./bin/dotr -classpath "$OUT" "$MAIN" > "$tmp"
66-
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"
67-
68-
# check that `dotc -from-tasty` compiles and `dotr` runs it
69-
echo "testing ./bin/dotc -from-tasty and dotr -classpath"
70-
clear_out "$OUT1"
71-
./bin/dotc -from-tasty -classpath "$OUT" -d "$OUT1" "$MAIN"
72-
./bin/dotr -classpath "$OUT1" "$MAIN" > "$tmp"
73-
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"
74-
75-
# echo ":quit" | ./dist-bootstrapped/target/pack/bin/dotr # not supported by CI
76-
77-
echo "testing ./bin/dotd"
78-
clear_out "$OUT"
79-
./bin/dotd -project Hello -siteroot "$OUT" "$SOURCE"
80-
8131
## Disabled because of flakeyness, should be changed to not depend on sbt
8232
# echo "running Vulpix meta test"
8333
# tmp=$(mktemp)

project/scripts/cmdTestsCommon.inc.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set -eux
2+
3+
SBT="./project/scripts/sbt" # if run on CI
4+
# SBT="sbt" # if run locally
5+
6+
SOURCE="tests/pos/HelloWorld.scala"
7+
MAIN="HelloWorld"
8+
EXPECTED_OUTPUT="hello world"
9+
10+
OUT=$(mktemp -d)
11+
OUT1=$(mktemp -d)
12+
tmp=$(mktemp)
13+
14+
clear_out()
15+
{
16+
local out="$1"
17+
rm -rf "$out/*"
18+
}

0 commit comments

Comments
 (0)