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
1234df77
Commit
1234df77
authored
Dec 24, 2018
by
Cristian Maglie
Committed by
Cristian Maglie
Jan 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use shared download folder for testing (saves bandwidth)
parent
61323e01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
commands/commands_test.go
commands/commands_test.go
+12
-5
No files found.
commands/commands_test.go
View file @
1234df77
...
...
@@ -257,6 +257,7 @@ func TestUploadCommands(t *testing.T) {
func
TestLibSearch
(
t
*
testing
.
T
)
{
defer
makeTempDataDir
(
t
)()
defer
makeTempSketchbookDir
(
t
)()
defer
useSharedDownloadDir
(
t
)()
exitCode
,
output
:=
executeWithArgs
(
t
,
"lib"
,
"search"
,
"audiozer"
,
"--format"
,
"json"
)
require
.
Zero
(
t
,
exitCode
,
"process exit code"
)
...
...
@@ -287,6 +288,7 @@ func TestLibSearch(t *testing.T) {
func
TestUserLibs
(
t
*
testing
.
T
)
{
defer
makeTempDataDir
(
t
)()
defer
makeTempSketchbookDir
(
t
)()
defer
useSharedDownloadDir
(
t
)()
libDir
:=
currSketchbookDir
.
Join
(
"libraries"
)
err
:=
libDir
.
MkdirAll
()
require
.
NoError
(
t
,
err
,
"creating 'sketchbook/libraries' dir"
)
...
...
@@ -323,6 +325,7 @@ func TestSketchCommands(t *testing.T) {
defer
makeTempSketchbookDir
(
t
)()
//var d []byte
var
exitCode
int
defer
useSharedDownloadDir
(
t
)()
exitCode
,
_
=
executeWithArgs
(
t
,
"sketch"
,
"new"
,
"Test"
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
...
...
@@ -333,6 +336,7 @@ func TestLibDownloadAndInstall(t *testing.T) {
defer
makeTempSketchbookDir
(
t
)()
var
d
[]
byte
var
exitCode
int
defer
useSharedDownloadDir
(
t
)()
exitCode
,
_
=
executeWithArgs
(
t
,
"core"
,
"update-index"
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
...
...
@@ -475,6 +479,7 @@ func detectLatestAVRCore(t *testing.T) string {
func
TestCompileCommands
(
t
*
testing
.
T
)
{
defer
makeTempDataDir
(
t
)()
defer
makeTempSketchbookDir
(
t
)()
defer
useSharedDownloadDir
(
t
)()
// Set staging dir to a temporary dir
tmp
,
err
:=
ioutil
.
TempDir
(
os
.
TempDir
(),
"test"
)
...
...
@@ -532,6 +537,7 @@ func TestCompileCommands(t *testing.T) {
func
TestInvalidCoreURL
(
t
*
testing
.
T
)
{
defer
makeTempDataDir
(
t
)()
defer
makeTempSketchbookDir
(
t
)()
defer
useSharedDownloadDir
(
t
)()
tmp
,
err
:=
paths
.
MkTempDir
(
""
,
""
)
require
.
NoError
(
t
,
err
,
"making temporary dir"
)
...
...
@@ -568,6 +574,7 @@ board_manager:
func
TestCoreCommands
(
t
*
testing
.
T
)
{
defer
makeTempDataDir
(
t
)()
defer
makeTempSketchbookDir
(
t
)()
defer
useSharedDownloadDir
(
t
)()
// Set staging dir to a temporary dir
tmp
,
err
:=
ioutil
.
TempDir
(
os
.
TempDir
(),
"test"
)
...
...
@@ -580,15 +587,15 @@ func TestCoreCommands(t *testing.T) {
// Download a specific core version
exitCode
,
d
:=
executeWithArgs
(
t
,
"core"
,
"download"
,
"arduino:avr@1.6.16"
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"arduino:avr-gcc@4.9.2-atmel3.5.3-arduino2 downloaded"
)
require
.
Contains
(
t
,
string
(
d
),
"arduino:avrdude@6.3.0-arduino8 downloaded"
)
require
.
Contains
(
t
,
string
(
d
),
"arduino:arduinoOTA@1.0.0 downloaded"
)
require
.
Contains
(
t
,
string
(
d
),
"arduino:avr@1.6.16 downloaded"
)
require
.
Regexp
(
t
,
"arduino:avr-gcc@4.9.2-atmel3.5.3-arduino2 (already )?downloaded"
,
string
(
d
)
)
require
.
Regexp
(
t
,
"arduino:avrdude@6.3.0-arduino8 (already )?downloaded"
,
string
(
d
)
)
require
.
Regexp
(
t
,
"arduino:arduinoOTA@1.0.0 (already )?downloaded"
,
string
(
d
)
)
require
.
Regexp
(
t
,
"arduino:avr@1.6.16 (already )?downloaded"
,
string
(
d
)
)
// Download latest
exitCode
,
d
=
executeWithArgs
(
t
,
"core"
,
"download"
,
"arduino:avr"
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
AVR
+
" downloaded"
)
require
.
Regexp
(
t
,
AVR
+
" (already )?downloaded"
,
string
(
d
)
)
// Wrong downloads
exitCode
,
d
=
executeWithArgs
(
t
,
"core"
,
"download"
,
"arduino:samd@1.2.3-notexisting"
)
...
...
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