Skip to content

Fix #3886: add tests for dotc/dotr/dotd #3892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ pipeline:
commands:
- cp -R . /tmp/1/ && cd /tmp/1/
- ./project/scripts/sbt ";compile ;test"
- ./project/scripts/sbtTests
- ./project/scripts/cmdTests

test_bootstrapped:
group: test
image: lampepfl/dotty:2018-01-17
commands:
- cp -R . /tmp/2/ && cd /tmp/2/
- ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test"
- ./project/scripts/sbtBootstrappedTests

test_optimised:
group: test
Expand Down
29 changes: 29 additions & 0 deletions project/scripts/sbtTests → project/scripts/cmdTests
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -66,3 +68,30 @@ 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

./project/scripts/sbt ";dist-bootstrapped/pack"
./dist-bootstrapped/target/pack/bin/dotc tests/run/hello.scala
./dist-bootstrapped/target/pack/bin/dotr Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove the three lines above. Lines 82-83 already exercise this

# echo ":quit" | ./dist-bootstrapped/target/pack/bin/dotr # not supported by CI
mkdir -p _site && ./dist-bootstrapped/target/pack/bin/dotd -project Hello -siteroot _site tests/run/hello.scala
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add set -eux under #!/usr/bin/env bash otherwise the exit code of the script will be the result of the last command ran

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Contributor

@allanrenucci allanrenucci Jan 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use ./bin/dotd instead

EDIT: Oups we don't have it. My bad. Maybe add an alias?

33 changes: 0 additions & 33 deletions project/scripts/sbtBootstrappedTests

This file was deleted.