Skip to content

Commit 5590c2d

Browse files
committed
cmdTests: Abstract some setup code
1 parent 8ea863b commit 5590c2d

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

project/scripts/cmdTests

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
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"
3+
source cmdTestsCommon.inc.sh
114

125
# check that benchmarks can run
136
"$SBT" "dotty-bench/jmh:run 1 1 tests/pos/alias.scala"
147
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
158

16-
OUT=$(mktemp -d)
17-
OUT1=$(mktemp -d)
18-
tmp=$(mktemp)
19-
20-
clear_out()
21-
{
22-
local out="$1"
23-
rm -rf "$out/*"
24-
}
25-
269
# check that `sbt dotc` compiles and `sbt dotr` runs it
2710
echo "testing sbt dotc and dotr"
2811
"$SBT" ";dotc $SOURCE -d $OUT ;dotr -classpath $OUT $MAIN" > "$tmp"

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)