Skip to content

Commit 9adecc4

Browse files
author
jantje
committed
#1274 Add regression test for ino and cpp
and cpp fails
1 parent e1c54f0 commit 9adecc4

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

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

+48
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,54 @@ public void issue687() throws Exception {
155155

156156
}
157157

158+
@Test
159+
public void createCPPProject() throws Exception {
160+
BoardDescription unoBoardid = Arduino.uno().getBoardDescriptor();
161+
162+
IProject theTestProject = null;
163+
String projectName = "createCPPProject";
164+
165+
CodeDescription codeDescriptor = CodeDescription.createDefaultCPP();
166+
try {
167+
theTestProject = SloeberProject.createArduinoProject(projectName, null, unoBoardid, codeDescriptor,
168+
new CompileDescription(), new NullProgressMonitor());
169+
Shared.waitForAllJobsToFinish(); // for the indexer
170+
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
171+
if (Shared.hasBuildErrors(theTestProject)) {
172+
fail("Failed to compile the project:" + projectName + " CPP project no longer work");
173+
}
174+
} catch (Exception e) {
175+
e.printStackTrace();
176+
fail("Failed to create the project:" + projectName);
177+
return;
178+
}
179+
180+
}
181+
182+
@Test
183+
public void createDefaultInoProject() throws Exception {
184+
BoardDescription unoBoardid = Arduino.uno().getBoardDescriptor();
185+
186+
IProject theTestProject = null;
187+
String projectName = "createDefaultInoProject";
188+
189+
CodeDescription codeDescriptor = CodeDescription.createDefaultIno();
190+
try {
191+
theTestProject = SloeberProject.createArduinoProject(projectName, null, unoBoardid, codeDescriptor,
192+
new CompileDescription(), new NullProgressMonitor());
193+
Shared.waitForAllJobsToFinish(); // for the indexer
194+
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
195+
if (Shared.hasBuildErrors(theTestProject)) {
196+
fail("Failed to compile the project:" + projectName + " INO project no longer work");
197+
}
198+
} catch (Exception e) {
199+
e.printStackTrace();
200+
fail("Failed to create the project:" + projectName);
201+
return;
202+
}
203+
204+
}
205+
158206
/**
159207
* support void loop{};
160208
*

0 commit comments

Comments
 (0)