Skip to content

Commit 28bd6cf

Browse files
author
gast1
committed
add unit test for #1662(multiple ino's in project)
1 parent b1197ef commit 28bd6cf

File tree

6 files changed

+65
-3
lines changed

6 files changed

+65
-3
lines changed

io.sloeber.tests/BuildTests Sloeber.launch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<setEntry value="io.sloeber.product.sdk"/>
1717
</setAttribute>
1818
<booleanAttribute key="includeOptional" value="true"/>
19-
<stringAttribute key="location" value="R:\buildSloeber"/>
19+
<stringAttribute key="location" value="C:\buildSloeber"/>
2020
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
2121
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
2222
<listEntry value="/io.sloeber.tests/src/io/sloeber/core/BuildTests.java"/>
@@ -25,15 +25,15 @@
2525
<listEntry value="1"/>
2626
</listAttribute>
2727
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
28-
<mapEntry key="SLOEBER_HOME" value="D:\"/>
28+
<mapEntry key="SLOEBER_HOME" value="c:\"/>
2929
</mapAttribute>
3030
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
3131
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="true"/>
3232
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
3333
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit5"/>
3434
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
3535
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
36-
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
36+
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre"/>
3737
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="io.sloeber.core.BuildTests"/>
3838
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
3939
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="io.sloeber.tests"/>

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,30 @@ public void issue687() throws Exception {
170170
assertNull(Shared.hasBuildErrors(theTestProject));
171171
}
172172

173+
174+
175+
/**
176+
* Test multiple ino's
177+
*/
178+
@Test
179+
public void multipleINOs() throws Exception {
180+
BoardDescription unoBoardid = Arduino.uno().getBoardDescriptor();
181+
182+
IProject theTestProject = null;
183+
String projectName = "multipleInos";
184+
IPath templateFolder = Shared.getTemplateFolder(projectName);
185+
CodeDescription codeDescriptor = CodeDescription.createCustomTemplate(templateFolder);
186+
theTestProject = SloeberProject.createArduinoProject(projectName, null, unoBoardid, codeDescriptor,
187+
new CompileDescription(), new NullProgressMonitor());
188+
Shared.waitForIndexer(theTestProject);
189+
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
190+
assertNull(Shared.hasBuildErrors(theTestProject));
191+
}
192+
193+
194+
195+
196+
173197
@Test
174198
public void create_CPP_based_Sloeber_Project() throws Exception {
175199
BoardDescription unoBoardid = Arduino.uno().getBoardDescriptor();
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
#ifndef PROJECT_INO_FILE
3+
#error Project ino file is not processed before this file
4+
#endif
5+
6+
void subIno3()
7+
{
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "Arduino.h"
2+
#define PROJECT_INO_FILE
3+
void setup()
4+
{
5+
subIno1();
6+
subIno2();
7+
}
8+
9+
void loop()
10+
{
11+
subIno3();
12+
}
13+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef PROJECT_INO_FILE
2+
#error Project ino file is not processed before this file
3+
#endif
4+
5+
void subIno1()
6+
{
7+
}
8+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
#ifndef PROJECT_INO_FILE
3+
#error Project ino file is not processed before this file
4+
#endif
5+
6+
void subIno2()
7+
{
8+
}
9+

0 commit comments

Comments
 (0)