forked from arduino/arduino-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not try to export binaries if --only-compilation-database is set (a…
…rduino#1181) * Do not try to export binaries if --only-compilation-database is set otherwise an empty "build/fqbn/..." folder is created if "always-export-binaries" option is set via config file. * slightly simplify function call * [skip changelog] Add integration test Co-authored-by: Silvano Cerza <[email protected]>
- Loading branch information
1 parent
0e6bb9e
commit fb30f2d
Showing
2 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -726,3 +726,35 @@ def test_compile_sketch_case_mismatch_fails(run_command, data_dir): | |
res = run_command(f"compile --clean -b {fqbn}", custom_working_dir=sketch_path) | ||
assert res.failed | ||
assert "Error during build: opening sketch: no valid sketch found" in res.stderr | ||
|
||
|
||
def test_compile_with_only_compilation_database_flag(run_command, data_dir): | ||
assert run_command("update") | ||
|
||
assert run_command("core install arduino:[email protected]") | ||
|
||
sketch_name = "CompileSketchOnlyCompilationDatabaseFlag" | ||
sketch_path = Path(data_dir, sketch_name) | ||
fqbn = "arduino:avr:uno" | ||
|
||
assert run_command(f"sketch new {sketch_path}") | ||
|
||
# Verifies no binaries exist | ||
build_path = Path(sketch_path, "build") | ||
assert not build_path.exists() | ||
|
||
# Compile with both --export-binaries and --only-compilation-database flags | ||
assert run_command(f"compile --export-binaries --only-compilation-database --clean -b {fqbn} {sketch_path}") | ||
|
||
# Verifies no binaries are exported | ||
assert not build_path.exists() | ||
|
||
# Verifies no binaries exist | ||
build_path = Path(data_dir, "export-dir") | ||
assert not build_path.exists() | ||
|
||
# Compile by setting the --output-dir flag and --only-compilation-database flags | ||
assert run_command(f"compile --output-dir {build_path} --only-compilation-database --clean -b {fqbn} {sketch_path}") | ||
|
||
# Verifies no binaries are exported | ||
assert not build_path.exists() |