8000 Do not compile test/* in included libraries · rosogon/arduino_ci@640201a · GitHub
[go: up one dir, main page]

Skip to content

Commit 640201a

Browse files
committed
Do not compile test/* in included libraries
If libB depends on libA, both with arduino_ci tests, trying to run the unit tests on libB will raise the error "multiple definition of main". This happens because cpp_files_libraries returns the whole tree of the referenced library (libA in the example), not removing the files in test/.
1 parent dc21420 commit 640201a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/arduino_ci/cpp_library.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ def cpp_files_unittest
186186
# @param [Array<String>] aux_libraries
187187
# @return [Array<Pathname>]
188188
def cpp_files_libraries(aux_libraries)
189-
arduino_library_src_dirs(aux_libraries).map { |d| cpp_files_in(d) }.flatten.uniq
189+
l = arduino_library_src_dirs(aux_libraries).map { |d| cpp_files_in(d) }.flatten.uniq
190+
l = l.reject { |p| p.dirname.to_s.end_with?("/test") }
190191
end
191192

192193
# Returns the Pathnames for all paths to exclude from testing and compilation

0 commit comments

Comments
 (0)
0