Skip to content

Commit

Permalink
Make scriptFeatureValidation the default in CompilerTestCase and disa…
Browse files Browse the repository at this point in the history
…ble it in broken tests

This will run for all tests that don't explicitly disable either feature set validation or ast validation.

NOTE: If this breaks your tests, just add disableValidateScriptFeatures() to your setUp() method.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202681157
  • Loading branch information
lauraharker committed Jul 2, 2018
1 parent 87ad08e commit a4d3536
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public final class ClosureOptimizePrimitivesTest extends CompilerTestCase {
protected void setUp() throws Exception {
super.setUp();
setAcceptedLanguage(LanguageMode.ECMASCRIPT_2017);
disableScriptFeatureValidation();
}

public void testObjectCreateOddParams() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ protected CompilerPass getProcessor(final Compiler compiler) {
protected void setUp() throws Exception {
super.setUp();
enableNormalize();
disableScriptFeatureValidation();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion test/com/google/javascript/jscomp/CompilerTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ protected void setUp() throws Exception {
this.allowSourcelessWarnings = false;
this.astValidationEnabled = true;
this.typeInfoValidationEnabled = false;
this.scriptFeatureValidationEnabled = false;
this.scriptFeatureValidationEnabled = true;
this.checkAccessControls = false;
this.checkAstChangeMarking = true;
this.checkLineNumbers = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ protected int getNumRepetitions() {
protected void setUp() throws Exception {
super.setUp();

disableScriptFeatureValidation();
parentModuleCanSeeSymbolsDeclaredInChildren = false;
}

Expand Down
1 change: 1 addition & 0 deletions test/com/google/javascript/jscomp/Es6ConvertSuperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected void setUp() throws Exception {
setLanguageOut(LanguageMode.ECMASCRIPT5);
enableRunTypeCheckAfterProcessing();
disableTypeCheck();
disableScriptFeatureValidation();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ protected void setUp() throws Exception {
setLanguageOut(LanguageMode.ECMASCRIPT3);
disableTypeCheck();
enableRunTypeCheckAfterProcessing();
disableScriptFeatureValidation();
}

public void testExtractionFromCall() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected void setUp() throws Exception {

enableTypeInfoValidation();
enableTypeCheck();
disableScriptFeatureValidation();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ protected void setUp() throws Exception {
setAcceptedLanguage(LanguageMode.ECMASCRIPT_2015);
enableTypeCheck();
enableTypeInfoValidation();
disableScriptFeatureValidation();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ protected void setUp() throws Exception {
setAcceptedLanguage(LanguageMode.ECMASCRIPT_2015);
disableTypeCheck();
enableRunTypeCheckAfterProcessing();
disableScriptFeatureValidation();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected void setUp() throws Exception {
// ECMASCRIPT5 to trigger module processing after parsing.
setLanguage(LanguageMode.ECMASCRIPT_2015, LanguageMode.ECMASCRIPT5);
enableRunTypeCheckAfterProcessing();
disableScriptFeatureValidation();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ protected void setUp() throws Exception {
resolutionMode = ModuleLoader.ResolutionMode.BROWSER;
prefixReplacements = ImmutableMap.of();
pathEscaper = PathEscaper.ESCAPE;
disableScriptFeatureValidation();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ protected void setUp() throws Exception {
setLanguageOut(LanguageMode.ECMASCRIPT3);
enableTypeInfoValidation();
enableTypeCheck();
disableScriptFeatureValidation();
}

// Spreading into array literals.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ protected void setUp() throws Exception {
setLanguageOut(LanguageMode.ECMASCRIPT3);
enableRunTypeCheckAfterProcessing();
disableTypeCheck();
disableScriptFeatureValidation();
}

protected final PassFactory makePassFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public final class Es6TypedToEs6ConverterTest extends CompilerTestCase {
protected void setUp() throws Exception {
super.setUp();
setAcceptedLanguage(LanguageMode.ECMASCRIPT6_TYPED);
disableScriptFeatureValidation();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ protected void setUp() throws Exception {
setAcceptedLanguage(LanguageMode.ECMASCRIPT_NEXT);
setLanguageOut(LanguageMode.ECMASCRIPT_2017);
enableRunTypeCheckAfterProcessing();
disableScriptFeatureValidation();
}

@Override
Expand Down
7 changes: 7 additions & 0 deletions test/com/google/javascript/jscomp/MinimizeExitPointsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
* @author [email protected] (John Lenz)
*/
public final class MinimizeExitPointsTest extends CompilerTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();

disableScriptFeatureValidation();
}

@Override
protected CompilerPass getProcessor(final Compiler compiler) {
return new PeepholeOptimizationsPass(compiler, getName(), new MinimizeExitPoints());
Expand Down
1 change: 1 addition & 0 deletions test/com/google/javascript/jscomp/MultiPassTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ protected void setUp() throws Exception {
setAcceptedLanguage(LanguageMode.ECMASCRIPT5);
enableNormalize();
enableGatherExternProperties();
disableScriptFeatureValidation();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public final class SubstituteEs6SyntaxTest extends CompilerTestCase {
protected void setUp() throws Exception {
super.setUp();
setAcceptedLanguage(CompilerOptions.LanguageMode.ECMASCRIPT_2015);
disableScriptFeatureValidation();
}

@Override
Expand Down

0 comments on commit a4d3536

Please sign in to comment.