@@ -111,9 +111,7 @@ public void issue555() throws CoreException {
111
111
}
112
112
try {
113
113
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , monitor );
114
- if (Shared .hasBuildErrors (theTestProject )) {
115
- fail ("Failed to compile the project:" + projectName + " as uno build errors" );
116
- }
114
+ Assert .assertNull (Shared .hasBuildErrors (theTestProject ));
117
115
} catch (CoreException e ) {
118
116
e .printStackTrace ();
119
117
fail ("Failed to compile the project:" + unoBoardid .getBoardName () + " as uno exception" );
@@ -133,12 +131,10 @@ public void issue555() throws CoreException {
133
131
134
132
try {
135
133
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , monitor );
136
- if (Shared .hasBuildErrors (theTestProject )) {
134
+ if (Shared .hasBuildErrors (theTestProject )!= null ) {
137
135
Shared .waitForAllJobsToFinish ();
138
136
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , monitor );
139
- if (Shared .hasBuildErrors (theTestProject )) {
140
- fail ("Failed to compile the project:" + projectName + " as teensy" );
141
- }
137
+ Assert .assertNull (Shared .hasBuildErrors (theTestProject ));
142
138
}
143
139
} catch (CoreException e ) {
144
140
e .printStackTrace ();
@@ -164,9 +160,7 @@ public void issue687() throws Exception {
164
160
new CompileDescription (), new NullProgressMonitor ());
165
161
Shared .waitForAllJobsToFinish (); // for the indexer
166
162
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , new NullProgressMonitor ());
167
- if (Shared .hasBuildErrors (theTestProject )) {
168
- fail ("Failed to compile the project:" + projectName + " issue687 is not fixed" );
169
- }
163
+ Assert .assertNull (Shared .hasBuildErrors (theTestProject ));
170
164
} catch (Exception e ) {
171
165
e .printStackTrace ();
172
166
fail ("Failed to create the project:" + projectName );
@@ -188,9 +182,7 @@ public void create_CPP_based_Sloeber_Project() throws Exception {
188
182
new CompileDescription (), new NullProgressMonitor ());
189
183
Shared .waitForAllJobsToFinish (); // for the indexer
190
184
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , new NullProgressMonitor ());
191
- if (Shared .hasBuildErrors (theTestProject )) {
192
- fail ("Failed to compile the project:" + projectName + " CPP project no longer work" );
193
- }
185
+ Assert .assertNull (Shared .hasBuildErrors (theTestProject ));
194
186
} catch (Exception e ) {
195
187
e .printStackTrace ();
196
188
fail ("Failed to create the project:" + projectName );
@@ -212,9 +204,7 @@ public void createDefaultInoProject() throws Exception {
212
204
new CompileDescription (), new NullProgressMonitor ());
213
205
Shared .waitForAllJobsToFinish (); // for the indexer
214
206
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , new NullProgressMonitor ());
215
- if (Shared .hasBuildErrors (theTestProject )) {
216
- fail ("Failed to compile the project:" + projectName + " INO project no longer work" );
217
- }
207
+ Assert .assertNull (Shared .hasBuildErrors (theTestProject ));
218
208
} catch (Exception e ) {
219
209
e .printStackTrace ();
220
210
fail ("Failed to create the project:" + projectName );
@@ -240,9 +230,7 @@ public void issue1047_Board_Names_Can_Be_used_as_Strings() throws Exception {
240
230
unoBoard .getBoardDescriptor (), codeDescriptor , new CompileDescription (), new NullProgressMonitor ());
241
231
Shared .waitForAllJobsToFinish (); // for the indexer
242
232
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , new NullProgressMonitor ());
243
- if (Shared .hasBuildErrors (theTestProject )) {
244
- fail ("Failed to compile the project:" + projectName + " issue1047 is not fixed" );
245
- }
233
+ Assert .assertNull (Shared .hasBuildErrors (theTestProject ));
246
234
} catch (Exception e ) {
247
235
e .printStackTrace ();
248
236
fail ("Failed to create the project:" + projectName );
@@ -278,10 +266,7 @@ public void are_jantjes_options_taken_into_account() throws Exception {
278
266
279
267
Shared .waitForAllJobsToFinish (); // for the indexer
280
268
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , monitor );
281
- if (Shared .hasBuildErrors (theTestProject )) {
282
- fail ("Failed to compile the project:" + projectName
283
- + " The defines have not been taken into account properly" );
284
- }
269
+ Assert .assertNull (Shared .hasBuildErrors (theTestProject ));
285
270
} catch (Exception e ) {
286
271
e .printStackTrace ();
287
272
fail ("Failed to create the project:" + projectName );
@@ -311,10 +296,7 @@ public void is_extern_C_taken_into_account() throws Exception {
311
296
312
297
Shared .waitForAllJobsToFinish (); // for the indexer
313
298
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , monitor );
314
- if (Shared .hasBuildErrors (theTestProject )) {
315
- fail ("Failed to compile the project:" + projectName
316
- + " extern \" C\" has not been taken into account properly." );
317
- }
299
+ Assert .assertNull (Shared .hasBuildErrors (theTestProject ));
318
300
} catch (Exception e ) {
319
301
e .printStackTrace ();
320
302
fail ("Failed to create the project:" + projectName );
@@ -343,10 +325,7 @@ public void are_defines_before_includes_taken_into_account() throws Exception {
343
325
344
326
Shared .waitForAllJobsToFinish (); // for the indexer
345
327
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , monitor );
346
- if (Shared .hasBuildErrors (theTestProject )) {
347
- fail ("Failed to compile the project:" + projectName
348
- + " defines have not been taken into account properly." );
349
- }
328
+ Assert .assertNull (Shared .hasBuildErrors (theTestProject ));
350
329
351
330
}
352
331
@@ -370,9 +349,7 @@ public void rename_Configuration() throws Exception {
370
349
371
350
Shared .waitForAllJobsToFinish (); // for the indexer
372
351
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , monitor );
373
- if (Shared .hasBuildErrors (theTestProject )) {
374
- fail ("Failed to compile the project before config rename" );
375
- }
352
+ Assert .assertNull ("Failed to compile the project before config rename" ,Shared .hasBuildErrors (theTestProject ));
376
353
377
354
CCorePlugin cCorePlugin = CCorePlugin .getDefault ();
378
355
ICProjectDescription prjCDesc = cCorePlugin .getProjectDescription (theTestProject );
@@ -382,9 +359,7 @@ public void rename_Configuration() throws Exception {
382
359
383
360
Shared .waitForAllJobsToFinish (); // for the indexer
384
361
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , monitor );
385
- if (Shared .hasBuildErrors (theTestProject )) {
386
- fail ("Failed to compile the project after config rename" );
387
- }
362
+ Assert .assertNull ("Failed to compile the project after config rename" ,Shared .hasBuildErrors (theTestProject ));
388
363
}
389
364
390
365
// /**
@@ -450,9 +425,7 @@ public void openAndClosePreservesSettings(String projectName , CodeDescription c
450
425
// also do a build
451
426
Shared .waitForAllJobsToFinish (); // for the indexer
452
427
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , null );
453
- if (Shared .hasBuildErrors (theTestProject )) {
454
- fail ("Failed to compile the project before close:" + projectName );
455
- }
428
+ Assert .assertNull ("Failed to compile the project before close: " + projectName ,Shared .hasBuildErrors (theTestProject ));
456
429
457
430
// also do a clean
458
431
Shared .waitForAllJobsToFinish (); // for the indexer
@@ -497,9 +470,7 @@ public void openAndClosePreservesSettings(String projectName , CodeDescription c
497
470
// also do a build
498
471
Shared .waitForAllJobsToFinish (); // for the indexer
499
472
theTestProject .build (IncrementalProjectBuilder .FULL_BUILD , null );
500
- if (Shared .hasBuildErrors (theTestProject )) {
501
- fail ("Failed to compile the project after open:" + projectName );
502
- }
473
+ Assert .assertNull ("Failed to compile the project after open: " + projectName ,Shared .hasBuildErrors (theTestProject ));
503
474
504
475
}
505
476
@@ -608,7 +579,7 @@ public void createProjectWithURI() throws Exception {
608
579
otherDesc , new NullProgressMonitor ());
609
580
610
581
proj .build (IncrementalProjectBuilder .FULL_BUILD , null );
611
- Assert .assertFalse ("Failed to compile the project: " + proj1Name , Shared .hasBuildErrors (proj ));
582
+ Assert .assertNull ("Failed to compile the project: " + Shared . hasBuildErrors ( proj ) , Shared .hasBuildErrors (proj ));
612
583
String fileLocation = projectFolder .append ("src" ).append (proj1Name + ".cpp" ).toString ();
613
584
614
585
IFile cppFile = proj .getFolder ("src" ).getFile (proj1Name + ".cpp" );
@@ -694,7 +665,7 @@ public void testDifferentSourceFolders(String projectName, CodeDescription codeD
694
665
Shared .waitForAllJobsToFinish (); // for the indexer
695
666
696
667
project .build (IncrementalProjectBuilder .FULL_BUILD , null );
697
- assertFalse ("Failed to compile " +projectName ,Shared .hasBuildErrors (project ));
668
+ assertNull ("Failed to compile " +projectName ,Shared .hasBuildErrors (project ));
698
669
699
670
String srcFolder =codeDescriptor .getCodeFolder ();
700
671
IFile cppFile =null ;
@@ -725,10 +696,8 @@ public void redirectedJson() throws Exception {
725
696
fail ("redirect Json " );
726
697
return ;
727
698
}
728
- if (!Shared .buildAndVerify ("redirect_json" , boardid , CodeDescription .createDefaultIno (),
729
- new CompileDescription ())) {
730
- fail (Shared .getLastFailMessage () );
731
- }
699
+ Assert .assertNull (Shared .buildAndVerify ("redirect_json" , boardid , CodeDescription .createDefaultIno (),
700
+ new CompileDescription ()));
732
701
}
733
702
734
703
@@ -785,9 +754,7 @@ public void NightlyBoardPatron( String name, MCUBoard boardID, Example example,C
785
754
786
755
BoardDescription boardDescriptor = boardID .getBoardDescriptor ();
787
756
boardDescriptor .setOptions (boardID .getBoardOptions (example ));
788
- if (!Shared .buildAndVerifyAllBuilders (name ,boardID .getBoardDescriptor (), codeDescriptor , compileOptions )) {
789
- fail (Shared .getLastFailMessage () );
790
- }
757
+ Assert .assertNull (Shared .buildAndVerifyAllBuilders (name ,boardID .getBoardDescriptor (), codeDescriptor , compileOptions ));
791
758
792
759
}
793
760
0 commit comments