Skip to content

Commit 95f6192

Browse files
committed
cmdTests: Abstract some setup code
1 parent 973b675 commit 95f6192

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,29 +1,12 @@
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 $(dirname $0)/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
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 -with-compiler compiler/src/dotty/tools/dotc/core/Types.scala"
169

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-
}
26-
2710
# check that `sbt dotc` compiles and `sbt dotr` runs it
2811
echo "testing sbt dotc and dotr"
2912
"$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)