File tree Expand file tree Collapse file tree 2 files changed +50
-27
lines changed Expand file tree Collapse file tree 2 files changed +50
-27
lines changed Original file line number Diff line number Diff line change 29
29
30
30
source " $PROG_HOME /bin/common"
31
31
32
- CLASS_PATH=" .$PSEP$DOTTY_LIB$PSEP$SCALA_LIB "
32
+ declare -a residual_args
33
+ run_repl=false
34
+ CLASS_PATH=" "
33
35
34
- # -d must be the first option
35
- case " $1 " in
36
- -d) DEBUG=" $DEBUG_STR " && shift ;;
37
- esac
36
+ while [[ $# -gt 0 ]]; do
37
+ case " $1 " in
38
+ -repl)
39
+ run_repl=true
40
+ shift
41
+ ;;
42
+ -classpath)
43
+ CLASS_PATH=" $2 "
44
+ shift
45
+ shift
46
+ ;;
47
+ -d)
48
+ DEBUG=" $DEBUG_STR "
49
+ shift
50
+ ;;
51
+ * )
52
+ residual_args+=(" $1 " )
53
+ shift
54
+ ;;
38
55
39
- first_arg=" $1 "
56
+ esac
57
+ done
40
58
41
- if [ -z " $1 " ]; then
42
- echo " Starting dotty REPL..."
43
- eval " $PROG_HOME /bin/dotc -repl"
44
- elif [[ ${first_arg: 0: 1} == " -" ]]; then
45
- eval " $PROG_HOME /bin/dotc -repl $@ "
59
+ if [ $run_repl == true ] || [ ${# residual_args[@]} -eq 0 ]; then
60
+ if [ " $CLASS_PATH " ]; then
61
+ cp_arg=" -classpath $CLASS_PATH "
62
+ fi
63
+ echo " Starting dotty REPL"
64
+ eval " $PROG_HOME /bin/dotc $cp_arg -repl ${residual_args[@]} "
46
65
else
47
- eval exec " \" $JAVACMD \" " " $DEBUG " " -classpath \" $CLASS_PATH \" " $@
66
+ cp_arg=" -classpath $DOTTY_LIB$PSEP$SCALA_LIB "
67
+ if [ -z " $CLASS_PATH " ]; then
68
+ cp_arg+=" $PSEP ."
69
+ else
70
+ cp_arg+=" $PSEP$CLASS_PATH "
71
+ fi
72
+ eval exec " \" $JAVACMD \" " " $DEBUG " " $cp_arg " " ${residual_args[@]} "
48
73
fi
Original file line number Diff line number Diff line change 3
3
# check that benchmarks can run
4
4
./project/scripts/sbt " dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
5
5
6
-
7
6
# setup for `dotc`/`dotr` script tests
8
7
./project/scripts/sbt dist-bootstrapped/pack
9
8
10
9
# check that `dotc` compiles and `dotr` runs it
11
10
echo " testing ./bin/dotc and ./bin/dotr"
12
11
mkdir out/scriptedtest0
13
12
./bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest0
14
- # FIXME #3477
15
- # ./bin/dotr -classpath out/scriptedtest0 dotrtest.Test" > sbtdotr1.out
16
- # if grep -e "dotr test ok" sbtdotr1.out; then
17
- # echo "output ok"
18
- # else
19
- # exit -1
20
- # fi
13
+
14
+ ./bin/dotr -classpath out/scriptedtest0 dotrtest.Test" > sbtdotr1.out
15
+ if grep -e " dotr test ok" sbtdotr1.out; then
16
+ echo " output ok"
17
+ else
18
+ exit -1
19
+ fi
21
20
22
21
23
22
# check that ` dotc` compiles and ` dotr` runs it
@@ -26,10 +25,9 @@ mkdir out/scriptedtest1
26
25
mkdir out/scriptedtest2
27
26
./bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest1/
28
27
./bin/dotc -from-tasty -classpath out/scriptedtest1/ -d out/scriptedtest2/ dotrtest.Test
29
- # FIXME #3477
30
- # ./bin/dotr -classpath out/scriptedtest2/ dotrtest.Test" > sbtdotr2.out
31
- # if grep -e "dotr test ok" sbtdotr2.out; then
32
- # echo "output ok"
33
- # else
34
- # exit -1
35
- # fi
28
+ ./bin/dotr -classpath out/scriptedtest2/ dotrtest.Test" > sbtdotr2.out
29
+ if grep -e " dotr test ok" sbtdotr2.out; then
30
+ echo " output ok"
31
+ else
32
+ exit -1
33
+ fi
You can’t perform that action at this time.
0 commit comments