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 2929
3030source " $PROG_HOME /bin/common"
3131
32- CLASS_PATH=" .$PSEP$DOTTY_LIB$PSEP$SCALA_LIB "
32+ declare -a residual_args
33+ run_repl=false
34+ CLASS_PATH=" "
3335
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+ ;;
3855
39- first_arg=" $1 "
56+ esac
57+ done
4058
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[@]} "
4665else
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[@]} "
4873fi
Original file line number Diff line number Diff line change 33# check that benchmarks can run
44./project/scripts/sbt " dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
55
6-
76# setup for `dotc`/`dotr` script tests
87./project/scripts/sbt dist-bootstrapped/pack
98
109# check that `dotc` compiles and `dotr` runs it
1110echo " testing ./bin/dotc and ./bin/dotr"
1211mkdir out/scriptedtest0
1312./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
2120
2221
2322# check that ` dotc` compiles and ` dotr` runs it
@@ -26,10 +25,9 @@ mkdir out/scriptedtest1
2625mkdir out/scriptedtest2
2726./bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest1/
2827./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