use of io.sloeber.core.api.CodeDescriptor in project arduino-eclipse-plugin by Sloeber.
the class RegressionTest method is_extern_C_taken_into_account.
/**
* If a .ino file is defining defines before including a include this should
* be handled properly by the ino to cpp parser
* @throws Exception
*/
@SuppressWarnings("static-method")
@Test
public void is_extern_C_taken_into_account() throws Exception {
PackageManager.installLatestPlatform("package_index.json", "arduino", "Arduino AVR Boards");
Map<String, String> unoOptions = new HashMap<>();
BoardDescriptor unoBoardid = PackageManager.getBoardDescriptor("package_index.json", "arduino", "Arduino AVR Boards", "uno", unoOptions);
IProject theTestProject = null;
String projectName = "defines_and_includes";
IPath templateFolder = Shared.getTemplateFolder(projectName);
CodeDescriptor codeDescriptor = CodeDescriptor.createCustomTemplate(templateFolder);
NullProgressMonitor monitor = new NullProgressMonitor();
try {
theTestProject = unoBoardid.createProject(projectName, null, ConfigurationDescriptor.getDefaultDescriptors(), codeDescriptor, new CompileOptions(null), monitor);
// for the indexer
Shared.waitForAllJobsToFinish();
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
if (Shared.hasBuildErrors(theTestProject)) {
fail("Failed to compile the project:" + projectName + " defines have not been taken into account properly.");
}
} catch (Exception e) {
e.printStackTrace();
fail("Failed to create the project:" + projectName);
return;
}
}
Aggregations