Permalink
Browse files

Allow full test suite runs

Finally tracked down how to properly fix the inter-dependency that
was preventing the full test suite being run (previously had to run
tests for each package individually).
  • Loading branch information...
1 parent 9276832 commit 945516acf041084f2aefd25c8d654f7dde18da5e @dmarcotte committed Mar 29, 2013
Showing with 13 additions and 6 deletions.
  1. +0 −1 contributing.md
  2. +13 −5 test/src/com/dmarcotte/handlebars/parsing/HbParserTest.java
View
@@ -21,7 +21,6 @@ The coding guidelines are pretty simple:
* Write tests surrounding your change
* Ensure that all existing tests pass with your change
- * **NOTE:** The tests in each package of `com.dmarcotte.handlebars` must currently be **run separately** due to a bad dependency between the different IDEA test scaffolding these tests need.
* Ensure that running "Analyze->Inspect Code..." in IDEA results only in warnings for spelling and the expected syntax errors in the test/data files
* Generally keep it clean and follow the coding style of the existing code
@@ -1,10 +1,12 @@
package com.dmarcotte.handlebars.parsing;
+import com.dmarcotte.handlebars.HbLanguage;
import com.dmarcotte.handlebars.config.PropertiesComponentStub;
import com.dmarcotte.handlebars.util.HbTestUtils;
import com.intellij.ide.util.PropertiesComponent;
-import com.intellij.openapi.fileTypes.LanguageFileType;
-import com.intellij.openapi.fileTypes.StdFileTypes;
+import com.intellij.lang.LanguageParserDefinitions;
+import com.intellij.psi.templateLanguages.TemplateDataLanguageMappings;
+import com.intellij.psi.templateLanguages.TemplateDataLanguagePatterns;
import com.intellij.testFramework.ParsingTestCase;
import org.picocontainer.MutablePicoContainer;
@@ -25,9 +27,6 @@
*/
public abstract class HbParserTest extends ParsingTestCase {
- @SuppressWarnings("UnusedDeclaration") // TODO odd... StdFileTypes is not initialized on time if it's not forward declared. Figure out what's up and remove this hack.
- private static LanguageFileType html = StdFileTypes.HTML;
-
public HbParserTest() {
super("parser", "hbs", new HbParseDefinition());
}
@@ -37,12 +36,21 @@ protected String getTestDataPath() {
return HbTestUtils.BASE_TEST_DATA_PATH;
}
+ protected boolean checkAllPsiRoots() {
+ return false;
+ }
+
@Override
protected void setUp() throws Exception {
super.setUp();
final MutablePicoContainer appContainer = getApplication().getPicoContainer();
appContainer.registerComponentInstance(PropertiesComponent.class.getName(),
new PropertiesComponentStub());
+ appContainer.registerComponentInstance(TemplateDataLanguageMappings.class.getName(),
+ new TemplateDataLanguageMappings(getProject()));
+ appContainer.registerComponentInstance(TemplateDataLanguagePatterns.class.getName(),
+ new TemplateDataLanguagePatterns());
+ addExplicitExtension(LanguageParserDefinitions.INSTANCE, HbLanguage.INSTANCE, new HbParseDefinition());
}
}

0 comments on commit 945516a

Please sign in to comment.