Writing incrementalCache attribute to <modules> element of xml module script

This commit is contained in:
Evgeny Gerashchenko
2014-06-18 17:05:49 +04:00
parent 06cafe7f12
commit f6129732a2
18 changed files with 141 additions and 76 deletions
@@ -16,6 +16,7 @@
package org.jetbrains.jet.modules.xml;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
import junit.framework.TestCase;
import org.jetbrains.annotations.NotNull;
@@ -36,7 +37,7 @@ public abstract class AbstractModuleXmlParserTest extends TestCase {
protected void doTest(String xmlPath) throws IOException {
File txtFile = new File(FileUtil.getNameWithoutExtension(xmlPath) + ".txt");
List<ModuleDescription> result = ModuleXmlParser.parse(xmlPath, new MessageCollector() {
Pair<List<ModuleDescription>, String> result = ModuleXmlParser.parseModuleDescriptionsAndIncrementalCacheDir(xmlPath, new MessageCollector() {
@Override
public void report(
@NotNull CompilerMessageSeverity severity, @NotNull String message, @NotNull CompilerMessageLocation location
@@ -46,7 +47,11 @@ public abstract class AbstractModuleXmlParserTest extends TestCase {
});
StringBuilder sb = new StringBuilder();
for (ModuleDescription description : result) {
if (result.second != null) {
sb.append("incrementalCacheDir=").append(result.second).append("\n\n");
}
for (ModuleDescription description : result.first) {
sb.append(description).append("\n");
}
@@ -56,6 +56,11 @@ public class ModuleXmlParserTestGenerated extends AbstractModuleXmlParserTest {
doTest("compiler/testData/modules.xml/emptyModule.xml");
}
@TestMetadata("incrementalCacheDir.xml")
public void testIncrementalCacheDir() throws Exception {
doTest("compiler/testData/modules.xml/incrementalCacheDir.xml");
}
@TestMetadata("manyTimes.xml")
public void testManyTimes() throws Exception {
doTest("compiler/testData/modules.xml/manyTimes.xml");