|
14 | 14 | # a commercial license, send an email to license@arduino.cc.
|
15 | 15 | import json
|
16 | 16 | import os
|
| 17 | +import platform |
17 | 18 |
|
18 | 19 | import pytest
|
19 | 20 |
|
@@ -83,23 +84,43 @@ def test_compile_with_simple_sketch(run_command, data_dir, working_dir):
|
83 | 84 | assert result.ok
|
84 | 85 | assert os.path.exists(target)
|
85 | 86 |
|
86 |
| - # Test the --output flag defaulting to current working dir |
| 87 | + # Test extention won't be added if already present |
87 | 88 | result = run_command(
|
88 |
| - "compile -b {fqbn} {sketch_path} -o test".format( |
| 89 | + "compile -b {fqbn} {sketch_path} -o test2.hex".format( |
89 | 90 | fqbn=fqbn, sketch_path=sketch_path
|
90 | 91 | )
|
91 | 92 | )
|
92 | 93 | assert result.ok
|
93 |
| - assert os.path.exists(os.path.join(working_dir, "test.hex")) |
| 94 | + assert os.path.exists(os.path.join(working_dir, "test2.hex")) |
94 | 95 |
|
95 |
| - # Test extention won't be added if already present |
| 96 | + |
| 97 | +@pytest.mark.skipif( |
| 98 | + running_on_ci() and platform.system() == "Windows", |
| 99 | + reason="Test disabled on Github Actions Win VM until tmpdir inconsistent behavior bug is fixed", |
| 100 | +) |
| 101 | +def test_output_flag_default_path(run_command, data_dir, working_dir): |
| 102 | + # Init the environment explicitly |
| 103 | + result = run_command("core update-index") |
| 104 | + assert result.ok |
| 105 | + |
| 106 | + # Download latest AVR |
| 107 | + result = run_command("core install arduino:avr") |
| 108 | + assert result.ok |
| 109 | + |
| 110 | + # Create a test sketch |
| 111 | + sketch_path = os.path.join(data_dir, "test_output_flag_default_path") |
| 112 | + fqbn = "arduino:avr:uno" |
| 113 | + result = run_command("sketch new {}".format(sketch_path)) |
| 114 | + assert result.ok |
| 115 | + |
| 116 | + # Test the --output flag defaulting to current working dir |
96 | 117 | result = run_command(
|
97 |
| - "compile -b {fqbn} {sketch_path} -o test2.hex".format( |
| 118 | + "compile -b {fqbn} {sketch_path} -o test".format( |
98 | 119 | fqbn=fqbn, sketch_path=sketch_path
|
99 | 120 | )
|
100 | 121 | )
|
101 | 122 | assert result.ok
|
102 |
| - assert os.path.exists(os.path.join(working_dir, "test2.hex")) |
| 123 | + assert os.path.exists(os.path.join(working_dir, "test.hex")) |
103 | 124 |
|
104 | 125 |
|
105 | 126 | def test_compile_with_sketch_with_symlink_selfloop(run_command, data_dir):
|
|
0 commit comments