Skip to content

Commit b84b666

Browse files
committed
Added simple smoke-test for compile --format json
1 parent 0374489 commit b84b666

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: test/test_compile.py

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import tempfile
1818
import hashlib
1919
from pathlib import Path
20+
import simplejson as json
2021

2122
import pytest
2223

@@ -55,6 +56,14 @@ def test_compile_with_simple_sketch(run_command, data_dir, working_dir):
5556
result = run_command(f"compile -b {fqbn} {sketch_path}")
5657
assert result.ok
5758

59+
# Build sketch for arduino:avr:uno with json output
60+
result = run_command(f"compile -b {fqbn} {sketch_path} --format json")
61+
assert result.ok
62+
# check is a valid json and contains requested data
63+
compile_output = json.loads(result.stdout)
64+
assert compile_output["compiler_out"] != ""
65+
assert compile_output["compiler_err"] == ""
66+
5867
# Verifies expected binaries have been built
5968
sketch_path_md5 = hashlib.md5(bytes(sketch_path)).hexdigest().upper()
6069
build_dir = Path(tempfile.gettempdir(), f"arduino-sketch-{sketch_path_md5}")

0 commit comments

Comments
 (0)