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
de5ac235
Commit
de5ac235
authored
Feb 14, 2019
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UploadsTests: go back to previous working directory after test
parent
66ce6f84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
21 deletions
+27
-21
commands/commands_test.go
commands/commands_test.go
+27
-21
No files found.
commands/commands_test.go
View file @
de5ac235
...
...
@@ -521,27 +521,33 @@ func TestCompileCommands(t *testing.T) {
require
.
True
(
t
,
paths
.
New
(
test1
)
.
Join
(
"Test1.arduino.avr.nano.hex"
)
.
Exist
())
// Build sketch with --output path
require
.
NoError
(
t
,
os
.
Chdir
(
tmp
))
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
"-b"
,
"arduino:avr:nano"
,
"-o"
,
"test"
,
test1
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch uses"
)
require
.
True
(
t
,
paths
.
New
(
"test.hex"
)
.
Exist
())
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
"-b"
,
"arduino:avr:nano"
,
"-o"
,
"test2.hex"
,
test1
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch uses"
)
require
.
True
(
t
,
paths
.
New
(
"test2.hex"
)
.
Exist
())
require
.
NoError
(
t
,
paths
.
New
(
tmp
,
"anothertest"
)
.
MkdirAll
())
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
"-b"
,
"arduino:avr:nano"
,
"-o"
,
"anothertest/test"
,
test1
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch uses"
)
require
.
True
(
t
,
paths
.
New
(
"anothertest"
,
"test.hex"
)
.
Exist
())
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
"-b"
,
"arduino:avr:nano"
,
"-o"
,
tmp
+
"/anothertest/test2"
,
test1
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch uses"
)
require
.
True
(
t
,
paths
.
New
(
"anothertest"
,
"test2.hex"
)
.
Exist
())
{
pwd
,
err
:=
os
.
Getwd
()
require
.
NoError
(
t
,
err
)
defer
func
()
{
require
.
NoError
(
t
,
os
.
Chdir
(
pwd
))
}()
require
.
NoError
(
t
,
os
.
Chdir
(
tmp
))
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
"-b"
,
"arduino:avr:nano"
,
"-o"
,
"test"
,
test1
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch uses"
)
require
.
True
(
t
,
paths
.
New
(
"test.hex"
)
.
Exist
())
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
"-b"
,
"arduino:avr:nano"
,
"-o"
,
"test2.hex"
,
test1
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch uses"
)
require
.
True
(
t
,
paths
.
New
(
"test2.hex"
)
.
Exist
())
require
.
NoError
(
t
,
paths
.
New
(
tmp
,
"anothertest"
)
.
MkdirAll
())
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
"-b"
,
"arduino:avr:nano"
,
"-o"
,
"anothertest/test"
,
test1
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch uses"
)
require
.
True
(
t
,
paths
.
New
(
"anothertest"
,
"test.hex"
)
.
Exist
())
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
"-b"
,
"arduino:avr:nano"
,
"-o"
,
tmp
+
"/anothertest/test2"
,
test1
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch uses"
)
require
.
True
(
t
,
paths
.
New
(
"anothertest"
,
"test2.hex"
)
.
Exist
())
}
}
func
TestInvalidCoreURL
(
t
*
testing
.
T
)
{
...
...
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