@@ -155,6 +155,54 @@ public void issue687() throws Exception {
155
155
156
156
}
157
157
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
+
158
206
/**
159
207
* support void loop{};
160
208
*
0 commit comments