Skip to content

Commit be5efb5

Browse files
committed
Added tests
1 parent 39d58c8 commit be5efb5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Diff for: test/test_profiles.py

+19
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,22 @@ def test_compile_with_profiles(run_command, copy_sketch):
2828
# use profile with the required library -> should succeed
2929
result = run_command(["compile", "-m", "avr2", sketch_path])
3030
assert result.ok
31+
32+
33+
def test_builder_did_not_catch_libs_from_unused_platforms(run_command, copy_sketch):
34+
# Init the environment explicitly
35+
run_command(["core", "update-index"])
36+
37+
sketch_path = copy_sketch("sketch_with_error_including_wire")
38+
39+
# install two platforms with the Wire library bundled
40+
assert run_command(["core", "install", "arduino:avr"])
41+
assert run_command(["core", "install", "arduino:samd"])
42+
43+
# compile for AVR
44+
result = run_command(["compile", "-b", "arduino:avr:uno", sketch_path])
45+
assert result.failed
46+
47+
# check that the libary resolver did not take the SAMD bundled Wire library into account
48+
assert "samd" not in result.stdout
49+
assert "samd" not in result.stderr
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include <Wire.h>
2+
3+
this sketch has syntax errors

0 commit comments

Comments
 (0)