Skip to content

Commit a574146

Browse files
committed
avoid problems related to finding a symbolic link
1 parent 04fa574 commit a574146

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/arduino_ci/cpp_library.rb

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,17 @@ def initialize(base_dir)
2727
end
2828

2929
def cpp_files_in(some_dir)
30-
Find.find(some_dir).select { |path| CPP_EXTENSIONS.include?(File.extname(path)) }
30+
real = File.realpath(some_dir)
31+
Find.find(real).select { |path| CPP_EXTENSIONS.include?(File.extname(path)) }
3132
end
3233

3334
# CPP files that are part of the project library under test
3435
def cpp_files
35-
cpp_files_in(@base_dir).reject { |p| p.start_with?(tests_dir + File::SEPARATOR) }
36+
real_tests_dir = File.realpath(tests_dir)
37+
cpp_files_in(@base_dir).reject do |p|
38+
next true if File.dirname(p).include?(tests_dir)
39+
next true if File.dirname(p).include?(real_tests_dir)
40+
end
3641
end
3742

3843
# CPP files that are part of the arduino mock library we're providing

0 commit comments

Comments
 (0)