Skip to content

Commit d7d5411

Browse files
committed
Fixed error message and integration tests
1 parent 3e0cf80 commit d7d5411

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cli/arguments/sketch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func InitSketchPath(path string) (sketchPath *paths.Path) {
4848
func NewSketch(sketchPath *paths.Path) *sketch.Sketch {
4949
sketch, err := sketch.New(sketchPath)
5050
if err != nil {
51-
feedback.Errorf(tr("Error creating sketch: %v"), err)
51+
feedback.Errorf(tr("Error opening sketch: %v"), err)
5252
os.Exit(errorcodes.ErrGeneric)
5353
}
5454
return sketch

test/test_compile_part_1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_compile_with_sketch_with_symlink_selfloop(run_command, data_dir):
131131
result = run_command(["compile", "-b", fqbn, sketch_path])
132132
# The assertion is a bit relaxed in this case because win behaves differently from macOs and linux
133133
# returning a different error detailed message
134-
assert "Error during build: Can't open sketch:" in result.stderr
134+
assert "Error opening sketch:" in result.stderr
135135
assert not result.ok
136136

137137
sketch_name = "CompileIntegrationTestSymlinkDirLoop"
@@ -153,7 +153,7 @@ def test_compile_with_sketch_with_symlink_selfloop(run_command, data_dir):
153153
result = run_command(["compile", "-b", fqbn, sketch_path])
154154
# The assertion is a bit relaxed in this case because win behaves differently from macOs and linux
155155
# returning a different error detailed message
156-
assert "Error during build: Can't open sketch:" in result.stderr
156+
assert "Error opening sketch:" in result.stderr
157157
assert not result.ok
158158

159159

test/test_compile_part_3.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,17 @@ def test_compile_sketch_with_multiple_main_files(run_command, data_dir):
9191
# Build sketch from folder
9292
res = run_command(["compile", "--clean", "-b", fqbn, sketch_path])
9393
assert res.failed
94-
assert "Error during build: Can't open sketch: multiple main sketch files found" in res.stderr
94+
assert "Error opening sketch: multiple main sketch files found" in res.stderr
9595

9696
# Build sketch from .ino file
9797
res = run_command(["compile", "--clean", "-b", fqbn, sketch_ino_file])
9898
assert res.failed
99-
assert "Error during build: Can't open sketch: multiple main sketch files found" in res.stderr
99+
assert "Error opening sketch: multiple main sketch files found" in res.stderr
100100

101101
# Build sketch from .pde file
102102
res = run_command(["compile", "--clean", "-b", fqbn, sketch_pde_file])
103103
assert res.failed
104-
assert "Error during build: Can't open sketch: multiple main sketch files found" in res.stderr
104+
assert "Error opening sketch: multiple main sketch files found" in res.stderr
105105

106106

107107
def test_compile_sketch_case_mismatch_fails(run_command, data_dir):
@@ -124,15 +124,15 @@ def test_compile_sketch_case_mismatch_fails(run_command, data_dir):
124124
# * Compiling with sketch path
125125
res = run_command(["compile", "--clean", "-b", fqbn, sketch_path])
126126
assert res.failed
127-
assert "Error during build: Can't open sketch: no valid sketch found" in res.stderr
127+
assert "Error opening sketch: no valid sketch found" in res.stderr
128128
# * Compiling with sketch main file
129129
res = run_command(["compile", "--clean", "-b", fqbn, sketch_main_file])
130130
assert res.failed
131-
assert "Error during build: Can't open sketch: no valid sketch found" in res.stderr
131+
assert "Error opening sketch: no valid sketch found" in res.stderr
132132
# * Compiling in sketch path
133133
res = run_command(["compile", "--clean", "-b", fqbn], custom_working_dir=sketch_path)
134134
assert res.failed
135-
assert "Error during build: Can't open sketch: no valid sketch found" in res.stderr
135+
assert "Error opening sketch: no valid sketch found" in res.stderr
136136

137137

138138
def test_compile_with_only_compilation_database_flag(run_command, data_dir):

test/test_compile_part_4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def test_compile_without_upload_and_fqbn(run_command, data_dir):
377377

378378
res = run_command(["compile", sketch_path])
379379
assert res.failed
380-
assert "Error during build: Missing FQBN (Fully Qualified Board Name)" in res.stderr
380+
assert "Missing FQBN (Fully Qualified Board Name)" in res.stderr
381381

382382

383383
def test_compile_non_installed_platform_with_wrong_packager_and_arch(run_command, data_dir):

test/test_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def test_compile_and_upload_combo_sketch_with_mismatched_casing(run_command, dat
364364
# Try to compile
365365
res = run_command(["compile", "--clean", "-b", board.fqbn, "-u", "-p", board.address, sketch_path])
366366
assert res.failed
367-
assert "Error during build: Can't open sketch: no valid sketch found in" in res.stderr
367+
assert "Error opening sketch: no valid sketch found in" in res.stderr
368368

369369

370370
def test_upload_sketch_with_mismatched_casing(run_command, data_dir, detected_boards, wait_for_board):

0 commit comments

Comments
 (0)