Skip to content

Commit 4aca218

Browse files
author
jantje
committed
test should fail before upgrade #1499
1 parent ebf1d8c commit 4aca218

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

io.sloeber.tests/src/io/sloeber/core/UpgradeTest.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.junit.Test;
1212

1313
import io.sloeber.core.api.Preferences;
14+
import io.sloeber.core.api.SloeberProject;
1415
import io.sloeber.providers.Arduino;
1516

1617
/**
@@ -43,7 +44,9 @@ public void setup() {
4344

4445
@Test
4546
public void upgradeSingleConfigProjectFromVersion4_3_3() throws Exception {
46-
47+
/*
48+
* A arduino uno project is upgraded that need the extra compile option extraCPP
49+
*/
4750
String projectName = "upgradeSingleConfigProject";
4851
String inputZipFile = Shared.getprojectZip("upgradeSingleConfigProject4_3_3.zip").toOSString();
4952
// /io.sloeber.tests/src/projects/upgradeSingleConfigProject4_3_3.zip
@@ -55,8 +58,15 @@ public void upgradeSingleConfigProjectFromVersion4_3_3() throws Exception {
5558
theTestProject.open(null);
5659
Shared.waitForAllJobsToFinish(); // for the indexer
5760
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, null);
61+
if (!Shared.hasBuildErrors(theTestProject)) {
62+
fail("The project has been automagically upgraded:" + projectName);
63+
}
64+
//try to convert the project
65+
SloeberProject.convertToArduinoProject(theTestProject, null);
66+
Shared.waitForAllJobsToFinish(); // for the indexer
67+
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, null);
5868
if (Shared.hasBuildErrors(theTestProject)) {
59-
fail("Failed to compile the project:" + projectName);
69+
fail("Failed to compile the upgraded project:" + projectName);
6070
}
6171
}
6272

0 commit comments

Comments
 (0)