Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New preprocessor #2729

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ hardware/arduino/bootloaders/caterina_LUFA/Caterina.elf
hardware/arduino/bootloaders/caterina_LUFA/Caterina.eep
hardware/arduino/bootloaders/caterina_LUFA/.dep/
build/libastylej-*.zip
build/ctags-*.zip
build/coan-*.zip
build/windows/work/
build/windows/*.zip
build/windows/*.tgz
Expand All @@ -25,6 +27,8 @@ build/windows/launch4j-*.tgz
build/windows/launch4j-*.zip
build/windows/launcher/launch4j
build/windows/WinAVR-*.zip
build/windows/ctags*
build/windows/coan*
build/macosx/arduino-*.zip
build/macosx/dist/*.tar.gz
build/macosx/dist/*.tar.bz2
Expand All @@ -35,14 +39,19 @@ build/macosx/appbundler*.zip
build/macosx/appbundler
build/macosx/appbundler-1.0ea-arduino2
build/macosx/appbundler-1.0ea-upstream1
build/macosx/ctags*
build/macosx/coan*
build/linux/work/
build/linux/dist/*.tar.gz
build/linux/dist/*.tar.bz2
build/linux/*.tgz
build/linux/*.tar.bz2
build/linux/*.tar.xz
build/linux/*.zip
build/linux/libastylej*
build/shared/reference*.zip
build/linux/ctags*
build/linux/coan*
test-bin
*.iml
.idea
Expand Down
1 change: 1 addition & 0 deletions app/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<fileset dir="test" includes="**/*.txt" />
<fileset dir="test" includes="**/*.properties" />
<fileset dir="test" includes="**/*.ino" />
<fileset dir="test" includes="**/*.h" />
</copy>

<junit printsummary="yes" dir="${work.dir}" fork="true">
Expand Down
6 changes: 6 additions & 0 deletions app/test/processing/app/AbstractWithPreferencesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

import org.junit.Before;

import java.io.File;
import java.util.LinkedList;

public abstract class AbstractWithPreferencesTest {

@Before
public void init() throws Exception {
Base.initPlatform();
BaseNoGui.initPackages();
BaseNoGui.scanAndUpdateLibraries(new LinkedList<File>());
BaseNoGui.populateImportToLibraryTable();
Preferences.init(null);
Theme.init();

Expand Down
39 changes: 39 additions & 0 deletions app/test/processing/app/LoadHardwareTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package processing.app;

import org.junit.Test;
import processing.app.debug.TargetPlatform;
import processing.app.helpers.PreferencesMap;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class LoadHardwareTest extends AbstractWithPreferencesTest {

@Test
public void shouldHaveLoadedTheParentPlatformTxtFiles() {
TargetPlatform targetPlatform = BaseNoGui.getTargetPlatform("arduino", "avr");

PreferencesMap ctags = targetPlatform.getTool("ctags");
assertNotNull(ctags);
assertEquals("{runtime.ide.path}/hardware/tools/ctags", ctags.get("cmd.path"));
assertEquals("\"{cmd.path}\" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzn \"{source_file}\"", ctags.get("pattern"));

PreferencesMap coan = targetPlatform.getTool("coan");
assertNotNull(coan);
assertEquals("{runtime.ide.path}/hardware/tools/coan", coan.get("cmd.path"));
assertEquals("\"{cmd.path}\" source -m -E -P -kb {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} \"{source_file}\"", coan.get("pattern"));

targetPlatform = BaseNoGui.getTargetPlatform("arduino", "sam");

ctags = targetPlatform.getTool("ctags");
assertNotNull(ctags);
assertEquals("{runtime.ide.path}/hardware/tools/ctags", ctags.get("cmd.path"));
assertEquals("\"{cmd.path}\" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzn \"{source_file}\"", ctags.get("pattern"));

coan = targetPlatform.getTool("coan");
assertNotNull(coan);
assertEquals("{runtime.ide.path}/hardware/tools/coan", coan.get("cmd.path"));
assertEquals("\"{cmd.path}\" source -m -E -P -kb {compiler.c.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.libsam.c.flags} \"{source_file}\"", coan.get("pattern"));
}

}
3 changes: 2 additions & 1 deletion app/test/processing/app/debug/UploaderFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.junit.Before;
import org.junit.Test;
import processing.app.AbstractWithPreferencesTest;
import processing.app.helpers.PreferencesMap;

import java.io.File;

Expand All @@ -19,7 +20,7 @@ public class UploaderFactoryTest extends AbstractWithPreferencesTest {

@Before
public void setUp() throws Exception {
targetPackage = new TargetPackage("arduino", new File(".", "hardware/arduino/"));
targetPackage = new TargetPackage("arduino", new File(".", "hardware/arduino/"), new PreferencesMap());
}

@Test
Expand Down
Loading