Open JeffFaer opened 9 years ago
Sorry for the long delay. That seems pretty reasonable to me, except for a concern about placing an annotation in every place we currently have the //BUG
comment - are all of those places legal to place an annotation?
Are you interested in contributing this still?
Hi, we (a group part of a software engineering course at KTH) are going to try and tackle some of this issue. The sheer amount of files this affects makes it difficult to estimate how much we will accomplish, in terms of reducing String
ly typed source code test cases and annotating with @Test
in Cases.java files, but the TestRunner and ExpectDiagnostic components will hopefully be implemented and then start the conversion.
So after working on this our group concludes, like the above comment suggests, annotations are not general enough to target all locations currently targeted by the // BUG
comments. Further, we find the solution of annotating **Cases.java
files with @RunWith(...)
as contradicting the purpose of those files, as they are really only resources. The intermediate test file that "includes" the Cases
files is the one which should have the custom runner annotation.
We are out of time working on this issue, but if someone were to develop this further we would revise the plan to:
@Test
to function like normal, but also operate on a new test annotation like @MultiTest
that incorporates some of the test diagnostics and compilation helpers code to add // BUG
occurences dynamically to the number of tests run for the overall test class.@MultiTest
annotation could set some mode inside the helpers that do this, as having an argument @MultiTest("FileWithCases.java")
may not be flexible enough.@MultiTest
annotation over the standard @Test
.
The current pattern for tests leaves something to be desired:
@Test
) so that it is easier to see exactly what is failing.String
ly typed source code. It's a pain in the neck to format it and add imports.String
. But we do have access to the AST...My proposal:
TestRunner
which will report each expected diagnostic as a separate test case with a specific name. Let's call itErrorProneRunner
.@RunWith(ErrorProneRunner.class)
String
ly typed source code and tell theErrorProneRunner
to do its thing (possibly with an annotation on *PositiveCases.java?)// BUG: Diagnostic contains: XXX
with@ExpectDiagnostic("specific expectation message")
:@DoNotExpectDiagnostic
Thoughts?