use of io.sloeber.core.api.CompileDescription in project arduino-eclipse-plugin by Sloeber.
the class CompileAndUpload method testExamples.
@Test
public void testExamples() throws Exception {
IPath templateFolder = Shared.getTemplateFolder("fastBlink");
CompileDescription compileOptions = new CompileDescription();
DateTimeFormatter df = DateTimeFormatter.ofPattern("YYYY/MM/dd-HH-mm-ss");
String SerialDumpContent = myName + '-' + df.format(LocalDateTime.now());
compileOptions.set_C_andCPP_CompileOptions("-DINTERVAL=" + interval + " -DSERIAlDUMP=" + SerialDumpContent);
CodeDescription codeDescriptor = CodeDescription.createCustomTemplate(templateFolder);
Map<String, String> replacers = new TreeMap<>();
replacers.put("{SerialMonitorSerial}", myBoard.mySerialPort);
codeDescriptor.setReplacers(replacers);
Build_Verify_upload(codeDescriptor, compileOptions, SerialDumpContent);
}
use of io.sloeber.core.api.CompileDescription in project arduino-eclipse-plugin by Sloeber.
the class NightlyBoardPatronTest method examples.
@SuppressWarnings("rawtypes")
@Parameters(name = "{0}")
public static Collection examples() {
Shared.setDeleteProjects(deleteProjects);
Preferences.setUseBonjour(false);
Shared.waitForAllJobsToFinish();
Arduino.installLatestSamDBoards();
LibraryManager.installLibrary("RTCZero");
Shared.waitForAllJobsToFinish();
Preferences.setUseArduinoToolSelection(true);
myCompileOptions = new CompileDescription();
MCUBoard zeroBoard = Arduino.zeroProgrammingPort();
LinkedList<Object[]> examples = new LinkedList<>();
TreeMap<String, IPath> exampleFolders = LibraryManager.getAllLibraryExamples();
for (Map.Entry<String, IPath> curexample : exampleFolders.entrySet()) {
String fqn = curexample.getKey().trim();
IPath examplePath = curexample.getValue();
// for patron Keith Willis. Thanks Keith
if (fqn.contains("RTCZero")) {
Example example = new Example(fqn, examplePath);
Object[] theData = new Object[] { Shared.getCounterName(example.getLibName() + ":" + fqn + ":" + zeroBoard.getID()), zeroBoard, example };
examples.add(theData);
}
}
return examples;
}
use of io.sloeber.core.api.CompileDescription in project arduino-eclipse-plugin by Sloeber.
the class RegressionTest method are_jantjes_options_taken_into_account.
/**
* This test will fail if the arduino compile option are not taken into account
* To do sa a bunch of defines are added to the command line and the code checks
* whether these defines are set properly
*
* @throws Exception
*/
@Test
public void are_jantjes_options_taken_into_account() throws Exception {
BoardDescription unoBoardid = Arduino.uno().getBoardDescriptor();
IProject theTestProject = null;
String projectName = "are_defines_found";
IPath templateFolder = Shared.getTemplateFolder(projectName);
CodeDescription codeDescriptor = CodeDescription.createCustomTemplate(templateFolder);
NullProgressMonitor monitor = new NullProgressMonitor();
try {
CompileDescription compileOptions = new CompileDescription();
compileOptions.set_C_andCPP_CompileOptions("-DTEST_C_CPP");
compileOptions.set_C_CompileOptions("-DTEST_C");
compileOptions.set_CPP_CompileOptions("-DTEST_CPP");
theTestProject = SloeberProject.createArduinoProject(projectName, null, unoBoardid, codeDescriptor, compileOptions, new NullProgressMonitor());
// for the indexer
Shared.waitForAllJobsToFinish();
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
if (Shared.hasBuildErrors(theTestProject)) {
fail("Failed to compile the project:" + projectName + " The defines have not been taken into account properly");
}
} catch (Exception e) {
e.printStackTrace();
fail("Failed to create the project:" + projectName);
return;
}
}
use of io.sloeber.core.api.CompileDescription in project arduino-eclipse-plugin by Sloeber.
the class RegressionTest method createDefaultInoProject.
@Test
public void createDefaultInoProject() throws Exception {
BoardDescription unoBoardid = Arduino.uno().getBoardDescriptor();
IProject theTestProject = null;
String projectName = "createDefaultInoProject";
CodeDescription codeDescriptor = CodeDescription.createDefaultIno();
try {
theTestProject = SloeberProject.createArduinoProject(projectName, null, unoBoardid, codeDescriptor, new CompileDescription(), new NullProgressMonitor());
// for the indexer
Shared.waitForAllJobsToFinish();
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
if (Shared.hasBuildErrors(theTestProject)) {
fail("Failed to compile the project:" + projectName + " INO project no longer work");
}
} catch (Exception e) {
e.printStackTrace();
fail("Failed to create the project:" + projectName);
return;
}
}
use of io.sloeber.core.api.CompileDescription in project arduino-eclipse-plugin by Sloeber.
the class RegressionTest method getBunkersCompileDescription.
static CompileDescription getBunkersCompileDescription() {
CompileDescription inCompileDescription = new CompileDescription();
inCompileDescription.set_All_CompileOptions("-Deen=1");
inCompileDescription.set_Archive_CompileOptions("-Dtwee=2");
inCompileDescription.set_Assembly_CompileOptions("-Drie=3");
inCompileDescription.set_C_andCPP_CompileOptions("-Dvier=4");
inCompileDescription.set_C_CompileOptions("-Dvijf=5");
inCompileDescription.set_Link_CompileOptions("-Dzes=6");
inCompileDescription.set_CPP_CompileOptions("-Dzeven=7");
inCompileDescription.setSizeCommand(SizeCommands.ARDUINO_WAY);
inCompileDescription.setEnableParallelBuild(true);
inCompileDescription.setWarningLevel(WarningLevels.NONE);
return inCompileDescription;
}
Aggregations