-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cleanup tests #3926
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
Cleanup tests #3926
Conversation
8f6701c to
aacd5ca
Compare
|
Need to rebase because of #3892 |
aacd5ca to
0891373
Compare
2835fdc to
1442757
Compare
|
@allanrenucci This is ready for review! |
allanrenucci
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two remarks:
- 9cfe19b moves tests that fail under legacy. Why do they fail under legacy and not with vulpix?
- I think a lot of tests in
pending/runare not meant to be ran but only meant to check warnings. We should convert them to neg tests with-Xfatal-warnings. Also, until they are converted, we should keep their.flags
| case self: SeparateCompilationSource => | ||
| self.dir.getPath | ||
| } | ||
| }).stripPrefix("../") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about we change the working directory when running tests? Something like:
baseDirectory in test := baseDirectory in ThisBuildWe could get rid of all the "../ in CompilationTest
tests/run/Meter.scala
Outdated
|
|
||
| println("x.hashCode: "+x.hashCode) | ||
| println("x == 1: "+(x == 1)) | ||
| println("x == 1: "+false) // Values of types a.Meter and Int cannot be compared with == or != |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this line or comment it out
tests/run/MeterCaseClass.scala
Outdated
|
|
||
| println("x.hashCode: "+x.hashCode) | ||
| println("x == 1: "+(x == 1)) | ||
| println("x == 1: "+false) // Values of types a.Meter and Int cannot be compared with == or != |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this line or comment it out
tests/run/literals.scala
Outdated
| check_success(".3f == 0.3f", .3f, 0.3f) | ||
| check_success("0f == 0.0f", 0f, 0.0f) | ||
| check_success("01.23f == 1.23f", 01.23f, 1.23f) | ||
| check_success("01.23f == 1.23f", /*0*/1.23f, 1.23f) // Non-zero numbers may not have a leading zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this line or comment it out
| compileFile("../tests/neg-custom-args/xfatalWarnings.scala", defaultOptions.and("-Xfatal-warnings")) + | ||
| compileFile("../tests/neg-custom-args/i3561.scala", defaultOptions.and("-Xfatal-warnings")) + | ||
| compileFile("../tests/neg-custom-args/pureStatement.scala", defaultOptions.and("-Xfatal-warnings")) + | ||
| compileFile("../tests/neg-custom-args/i3589-a.scala", defaultOptions.and("-Xfatal-warnings")) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! We support emitting switch on value classes. Maybe open an issue to figure out if this is expected or not.
ef1bd27 to
9af5e08
Compare
|
9af5e08 to
68a67e1
Compare
|
@allanrenucci There is an unfortunate side effect of |
80518fa to
a3fa888
Compare
This is to simplify the scripts written in the next commits. I don't believe this separation brings a lot of value, so propose to just keep it that way.
Using the following script: find tests/untried/???/ tests/pending/???/ -maxdepth 1 -mindepth 1 -not -name "*.check" -not -name "*.flags" | while read t; do pref=$(echo "$t" | cut -f 1-2 -d "/") name=$(echo "$t" | rev | cut -f 1 -d "/" | rev) type=$(echo "$t" | cut -f 3 -d "/") mv "$t" "tests/$type" base=$(basename $name .scala) mv "$pref/$type/$base.check" "tests/$type" 2>/dev/null mv "$pref/$type/$base.flags" "tests/$type" 2>/dev/null echo ";testCompilation $name ;eval scala.tools.nsc.io.File(\"/home/olivier/works\").appendAll(\"$t\\n\")" done | sbt git stash cat /home/olivier/works | while read t; do # same loop as above
Some of these warnning are also emitted by dotc, but they are not captured by the testing infreastructure and shouldn't be part of check files.
I used the following script:
mkdir filtered filtered/pos filtered/neg filtered/run
find tests/untried/???/ tests/pending/???/ -name *.scala | while read t;
do
grep --silent '.partest.' "$t" && (
pref=$(echo "$t" | cut -f 1-2 -d "/")
type=$(echo "$t" | cut -f 3 -d "/")
name=$(echo "$t" | cut -f 4 -d "/")
echo "$pref/$type/$name"
mv "$pref/$type/$name" "filtered/$type"
base=$(basename $name .scala)
mv "$pref/$type/$base.check" "filtered/$type" 2>/dev/null
mv "$pref/$type/$base.flags" "filtered/$type" 2>/dev/null
)
done
mv filtered tests/untried/partest
With '.partest.', '.reflect.' and ' forSome {'.
Using the following script: find tests -name "*.check" -or -name "*.flags" | while read t; do name=$(echo "$t" | cut -f -1 -d .) test -f "$name.scala" -o -d "$name" || rm "$t" done
See tests/pos/i2104.scala
This reverts commit a9aaff8.
a3fa888 to
133b8ff
Compare
|
@allanrenucci Review addressed and CI green, let me know what you think! |
41fda8f to
8547e85
Compare
allanrenucci
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @OlivierBlanvillain for taking care of this tedious work
After scala#3926, test logs were outputted to the dotty project parent folder
This PR cleans up the tests, to summarize:
Activate all the passing tests from tests/pending/* and tests/untried/*
Disable all the the pending tests that use
scala.reflect._, existential types and are depending on things fromscala.tools.partest._Clean up warnings from pending tests
Clean up all orphan .check and .flags files
This is best reviewed commit by commit