diff --git a/.drone.yml b/.drone.yml index e8b0eaa00c02..2cbbadfdddbd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,7 +27,7 @@ pipeline: commands: - cp -R . /tmp/1/ && cd /tmp/1/ - ./project/scripts/sbt ";compile ;test" - - ./project/scripts/sbtTests + - ./project/scripts/cmdTests test_bootstrapped: group: test @@ -35,7 +35,6 @@ pipeline: commands: - cp -R . /tmp/2/ && cd /tmp/2/ - ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test" - - ./project/scripts/sbtBootstrappedTests test_optimised: group: test diff --git a/bin/dotd b/bin/dotd new file mode 100755 index 000000000000..ef20298de154 --- /dev/null +++ b/bin/dotd @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.." + +eval "$ROOT/bin/common" "$ROOT/dist-bootstrapped/target/pack/bin/dotd" "$@" diff --git a/project/scripts/sbtTests b/project/scripts/cmdTests similarity index 70% rename from project/scripts/sbtTests rename to project/scripts/cmdTests index 4e5349a98f26..ce15c34f48ff 100755 --- a/project/scripts/sbtTests +++ b/project/scripts/cmdTests @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -eux + # check that benchmarks can run ./project/scripts/sbt "dotty-bench/jmh:run 1 1 tests/pos/alias.scala" @@ -66,3 +68,27 @@ else echo "failed output check" exit -1 fi + + +# check that benchmarks can run +./project/scripts/sbt "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala" + +# setup for `dotc`/`dotr` script tests +./project/scripts/sbt dist-bootstrapped/pack + +# check that `dotc` compiles and `dotr` runs it +echo "testing ./bin/dotc and ./bin/dotr" +mkdir -p out/scriptedtest0 +./bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest0 +./bin/dotr -classpath out/scriptedtest0 dotrtest.Test + +# check that `dotc -from-tasty` compiles and `dotr` runs it +echo "testing ./bin/dotc -from-tasty and dotr -classpath" +mkdir -p out/scriptedtest1 +mkdir -p out/scriptedtest2 +./bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest1/ +./bin/dotc -from-tasty -classpath out/scriptedtest1/ -d out/scriptedtest2/ dotrtest.Test +./bin/dotr -classpath out/scriptedtest2/ dotrtest.Test + +# echo ":quit" | ./dist-bootstrapped/target/pack/bin/dotr # not supported by CI +mkdir -p _site && ./bin/dotd -project Hello -siteroot _site tests/run/hello.scala diff --git a/project/scripts/sbtBootstrappedTests b/project/scripts/sbtBootstrappedTests deleted file mode 100755 index aaa0dfe3af4f..000000000000 --- a/project/scripts/sbtBootstrappedTests +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# check that benchmarks can run -./project/scripts/sbt "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala" - -# setup for `dotc`/`dotr` script tests -./project/scripts/sbt dist-bootstrapped/pack - -# check that `dotc` compiles and `dotr` runs it -echo "testing ./bin/dotc and ./bin/dotr" -mkdir out/scriptedtest0 -./bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest0 - -./bin/dotr -classpath out/scriptedtest0 dotrtest.Test" > sbtdotr1.out -if grep -e "dotr test ok" sbtdotr1.out; then - echo "output ok" -else - exit -1 -fi - - -# check that `dotc` compiles and `dotr` runs it -echo "testing ./bin/dotc -from-tasty and dotr -classpath" -mkdir out/scriptedtest1 -mkdir out/scriptedtest2 -./bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest1/ -./bin/dotc -from-tasty -classpath out/scriptedtest1/ -d out/scriptedtest2/ dotrtest.Test -./bin/dotr -classpath out/scriptedtest2/ dotrtest.Test" > sbtdotr2.out -if grep -e "dotr test ok" sbtdotr2.out; then - echo "output ok" -else - exit -1 -fi