Log when a pass is run with OTI or NTI.
If a test fails only under one of the two typecheckers,
this makes it easier to see which one failed by looking at the log output.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package com.google.javascript.jscomp;
import java.io.IOException;
import java.util.List;
+import java.util.logging.Logger;
/**
* CompilerTestCase for passes that run after type checking and use type information.
@@ -27,6 +27,9 @@ import java.util.List;
*/
public abstract class TypeICompilerTestCase extends CompilerTestCase {
+ private static final Logger logger =
+ Logger.getLogger("com.google.javascript.jscomp.TypeICompilerTestCase");
+
protected static enum TypeInferenceMode {
NEITHER,
OTI_ONLY,
@@ -77,13 +80,16 @@ public abstract class TypeICompilerTestCase extends CompilerTestCase {
Diagnostic diagnostic,
List<Postcondition> postconditions) {
if (this.mode.runsOTI()) {
+ logger.info("Running with OTI");
testOTI(externs, js, expected, diagnostic, postconditions);
}
if (this.mode.runsNTI()) {
+ logger.info("Running with NTI");
checkMinimalExterns(externs.externs);
testNTI(externs, js, expected, diagnostic, postconditions);
}
if (this.mode.runsNeither()) {
+ logger.info("Running without typechecking");
super.testInternal(externs, js, expected, diagnostic, postconditions);
}
}
