1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Don't create empty test files.

This commit is contained in:
Sergey Prigogin 2012-01-19 12:45:49 -08:00
parent ecb3820c77
commit 6408fe544c

View file

@ -66,12 +66,12 @@ public abstract class RefactoringTestBase extends BaseTestCase {
protected RefactoringTestBase(String name) {
super(name);
}
@Override
public void setUp() throws Exception {
super.setUp();
cproject = cpp ?
CProjectHelper.createCCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER) :
CProjectHelper.createCCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER) :
CProjectHelper.createCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER);
Bundle bundle = CTestPlugin.getDefault().getBundle();
CharSequence[] testData = TestSourceReader.getContentsForTest(bundle, "ui", getClass(), getName(), 0);
@ -94,9 +94,11 @@ public abstract class RefactoringTestBase extends BaseTestCase {
}
}
reader.close();
TestSourceReader.createFile(cproject.getProject(), new Path(testFile.getName()),
testFile.getSource());
if (!testFile.getSource().isEmpty()) {
TestSourceReader.createFile(cproject.getProject(), new Path(testFile.getName()),
testFile.getSource());
}
testFiles.add(testFile);
if (testFile.getName().endsWith(".xml")) {
historyScript = testFile;
@ -292,7 +294,7 @@ public abstract class RefactoringTestBase extends BaseTestCase {
String actualSource = getFileContents(file);
assertEquals(testFile.getExpectedSource(), actualSource);
}
protected void compareFiles() throws Exception {
for (TestSourceFile testFile : testFiles) {
String expectedSource = testFile.getExpectedSource();