Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
e0d983a8
Unverified
Commit
e0d983a8
authored
Oct 20, 2021
by
Silvano Cerza
Committed by
GitHub
Oct 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile error message not printed to correct writer on error (#1523)
parent
b12168cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
legacy/builder/container_find_includes.go
legacy/builder/container_find_includes.go
+1
-2
test/test_compile.py
test/test_compile.py
+25
-0
No files found.
legacy/builder/container_find_includes.go
View file @
e0d983a8
...
...
@@ -95,7 +95,6 @@ package builder
import
(
"encoding/json"
"fmt"
"os"
"os/exec"
"time"
...
...
@@ -378,7 +377,7 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFile t
return
errors
.
New
(
tr
(
"Internal error in cache"
))
}
}
os
.
Stderr
.
Write
(
preproc_stderr
)
ctx
.
Exec
Stderr
.
Write
(
preproc_stderr
)
return
errors
.
WithStack
(
preproc_err
)
}
...
...
test/test_compile.py
View file @
e0d983a8
...
...
@@ -1252,3 +1252,28 @@ def test_compile_with_relative_build_path(run_command, data_dir, copy_sketch):
assert
"libraries"
in
built_files
assert
"preproc"
in
built_files
assert
"sketch"
in
built_files
def
test_compile_error_returned_if_library_not_installed
(
run_command
,
copy_sketch
):
assert
run_command
([
"update"
])
run_command
([
"core"
,
"install"
,
"arduino:avr@1.8.3"
])
sketch_name
=
"sketch_with_sd_library"
sketch_path
=
copy_sketch
(
sketch_name
)
fqbn
=
"arduino:avr:uno"
res
=
run_command
([
"compile"
,
"-b"
,
fqbn
,
"--format"
,
"json"
,
sketch_path
])
assert
res
.
ok
compile_output
=
json
.
loads
(
res
.
stdout
)
sketch_main_file
=
f"
{
Path
(
sketch_path
,
sketch_name
)
}
.ino"
expected_error
=
(
f"
{
sketch_main_file
}
:2:10: fatal error: SD.h: No such file or directory
\n
#include <SD.h>
\n
"
+
" ^~~~~~
\n
compilation terminated.
\n
"
)
assert
not
compile_output
[
"success"
]
assert
compile_output
[
"compiler_out"
]
==
""
assert
compile_output
[
"compiler_err"
].
replace
(
"
\r\n
"
,
"
\n
"
)
==
expected_error
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment