-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Neg tests check files for // error markers #720
Conversation
acd7306
to
955cbe7
Compare
Thank you very much for your comments. I restructured the code to start by reading the files, and then check the two error categories independently. Hopefully it's clearer now. |
@@ -210,6 +210,8 @@ abstract class Reporter { | |||
var warningCount = 0 | |||
def hasErrors = errorCount > 0 | |||
def hasWarnings = warningCount > 0 | |||
private var errors: List[Error] = Nil | |||
def allErrors = errors |
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 am not super-happy with recording all errors here. That should be the job of individual reporters, not of the base class Reporter
. I believe it would be better to install a particular reporter that stores the errors in the test framework.
@vsalvis, do you want to give it a shot and try to make a reporter that records errors? Otherwise I'd merge this to make new tests use this machinery. |
I'm in a dance camp, so I don't think it's going to happen this week. But I On Mon, Jul 27, 2015 at 4:19 PM, Dmitry Petrashko notifications@github.com
|
Rebased version: #1106 |
Lazy fields null out fields that are used only in their initializer. When the lazy value is forced, it will null out all private fields that are used only by the current lazy value. This should reduce memory leaks, see scala#720
Neg tests run by JUnit now check that for each compiler error, there's a // error marker on the corresponding line in the source file. For errors that don't have a source position, add // nopos-error to any of the files (for an example of this, see instantiateAbstract).
Also FYI I had one case where not all errors get displayed by the compiler, maybe if there are more than two errors for a given line? In this file there are three errors displayed, but four errors total, and the test gets all four:
Do we plan on running neg tests on partest? In that case I have to add the functionality there as well, for now it's just the JUnit tests, while partest only checks the xerrors as before.