Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed May 30, 2022
1 parent 39d58c8 commit be5efb5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,22 @@ def test_compile_with_profiles(run_command, copy_sketch):
# use profile with the required library -> should succeed
result = run_command(["compile", "-m", "avr2", sketch_path])
assert result.ok


def test_builder_did_not_catch_libs_from_unused_platforms(run_command, copy_sketch):
# Init the environment explicitly
run_command(["core", "update-index"])

sketch_path = copy_sketch("sketch_with_error_including_wire")

# install two platforms with the Wire library bundled
assert run_command(["core", "install", "arduino:avr"])
assert run_command(["core", "install", "arduino:samd"])

# compile for AVR
result = run_command(["compile", "-b", "arduino:avr:uno", sketch_path])
assert result.failed

# check that the libary resolver did not take the SAMD bundled Wire library into account
assert "samd" not in result.stdout
assert "samd" not in result.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <Wire.h>

this sketch has syntax errors

0 comments on commit be5efb5

Please sign in to comment.