-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #5743: Add check files to neg tests #5852
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
Conversation
The check files contains the error messages positions and messages
Note that I did not print the position with the classical format to not loose the point information the difference between |
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.
Otherwise, LGTM
if (file.isDirectory) Nil | ||
else { | ||
val checkFile = new JFile(file.getAbsolutePath.reverse.dropWhile(_ != '.').reverse + "check") | ||
checkFileTest(testSource.title, checkFile, reporterOutputLines(reporter)) |
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.
reporterOutputLines
will give you all the errors reported but you only want the errors from the current file, right?
Let's say you have files A.scala
, B.scala
, A.check
and B.check
, I suspect this will not work
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.
No, if there are multiple files, the check file will be on the directory of the test. Just like for run
and pos
tests. I will make sure that the order of error outputs is stable.
val (compilerCrashed, expectedErrors, actualErrors, hasMissingAnnotations, errorMap) = testSource match { | ||
case testSource @ JointCompilationSource(_, files, flags, outDir, fromTasty, decompilation) => | ||
val sourceFiles = testSource.sourceFiles | ||
val (errorMap, expectedErrors) = getErrorMapAndExpectedCount(sourceFiles) | ||
val reporter = compile(sourceFiles, flags, true, outDir) | ||
val actualErrors = reporter.errorCount | ||
|
||
files.foreach { file => |
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.
sourceFiles
? => no special case for directory
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.
That is the way it works for pos
and run
tests.
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
@allanrenucci Merging now to shorten the PR queue. Please feel free to leave more comments and we can address in a later PR. |
The check files contain the error messages positions and messages. Warnings can be checked using
tests/neg-custom-args/fatal-warnings
.