Skip to content

Commit a94ef1e

Browse files
author
James Foster
committed
Only add ARDUINO=100 if it is not otherwise defined.
1 parent 0cb9778 commit a94ef1e

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

SampleProjects/TestSomething/.arduino-ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
platforms:
2+
3+
uno:
4+
board: arduino:avr:uno
5+
package: arduino:avr
6+
gcc:
7+
features:
8+
defines:
9+
- __AVR_ATmega328P__
10+
- ARDUINO=10813
11+
warnings:
12+
flags:
13+
due:
14+
board: arduino:sam:arduino_due_x
15+
package: arduino:sam
16+
gcc:
17+
features:
18+
defines:
19+
- __AVR_ATmega328__
20+
- ARDUINO=10813
21+
warnings:
22+
flags:
23+
124
unittest:
225
exclude_dirs:
326
- excludeThis

lib/arduino_ci/cpp_library.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def build_for_test_with_configuration(test_file, aux_libraries, gcc_binary, ci_g
324324
executable = Pathname.new("unittest_#{base}.bin").expand_path
325325
File.delete(executable) if File.exist?(executable)
326326
arg_sets = []
327-
arg_sets << ["-std=c++0x", "-o", executable.to_s, "-DARDUINO=10813"]
327+
arg_sets << ["-std=c++0x", "-o", executable.to_s]
328328
if libasan?(gcc_binary)
329329
arg_sets << [ # Stuff to help with dynamic memory mishandling
330330
"-g", "-O1",
@@ -334,6 +334,9 @@ def build_for_test_with_configuration(test_file, aux_libraries, gcc_binary, ci_g
334334
]
335335
end
336336
arg_sets << test_args(aux_libraries, ci_gcc_config)
337+
if (arg_sets.flatten(1).index{|s| s.include?("-DARDUINO=")} == nil)
338+
arg_sets << ["-DARDUINO=100"]
339+
end
337340
arg_sets << cpp_files_libraries(aux_libraries).map(&:to_s)
338341
arg_sets << [test_file.to_s]
339342
args = arg_sets.flatten(1)

0 commit comments

Comments
 (0)