Skip to content

Commit ca12012

Browse files
committed
remove emptyness test, it depends on the state of the machine running the tests
1 parent 18d9529 commit ca12012

File tree

2 files changed

+34
-20
lines changed

2 files changed

+34
-20
lines changed

Diff for: cli/cli_test.go

-20
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"os"
2626
"os/exec"
2727
"path/filepath"
28-
"strings"
2928
"testing"
3029

3130
"bou.ke/monkey"
@@ -544,10 +543,6 @@ board_manager:
544543
err = ioutil.WriteFile(filepath.Join(currDataDir, "library_index.json"), []byte(`{ "libraries": [] }`), os.FileMode(0644))
545544
require.NoError(t, err, "Writing empty json index file")
546545

547-
// Empty cores list
548-
exitCode, _ := executeWithArgs("--config-file", configFile, "core", "list")
549-
require.Zero(t, exitCode)
550-
551546
// Dump config with cmd-line specific file
552547
exitCode, d := executeWithArgs("--config-file", configFile, "config", "dump")
553548
require.Zero(t, exitCode)
@@ -556,11 +551,6 @@ board_manager:
556551
// Update inexistent index
557552
exitCode, _ = executeWithArgs("--config-file", configFile, "core", "update-index")
558553
require.NotZero(t, exitCode)
559-
560-
// Empty cores list
561-
exitCode, d = executeWithArgs("--config-file", configFile, "core", "list")
562-
require.Zero(t, exitCode)
563-
require.Empty(t, strings.TrimSpace(string(d)))
564554
}
565555

566556
func TestCoreCommandsIntegration(t *testing.T) {
@@ -601,11 +591,6 @@ func TestCoreCommandsIntegration(t *testing.T) {
601591
require.NotZero(t, exitCode)
602592
require.Contains(t, string(d), "invalid item")
603593

604-
// Empty cores list
605-
exitCode, d = executeWithArgs("core", "list")
606-
require.Zero(t, exitCode)
607-
require.Empty(t, strings.TrimSpace(string(d)))
608-
609594
// Install avr 1.6.16
610595
exitCode, d = executeWithArgs("core", "install", "arduino:[email protected]")
611596
require.Zero(t, exitCode)
@@ -671,9 +656,4 @@ func TestCoreCommandsIntegration(t *testing.T) {
671656
exitCode, d = executeWithArgs("core", "uninstall", "arduino:avr")
672657
require.Zero(t, exitCode)
673658
require.Contains(t, string(d), AVR+" uninstalled")
674-
675-
// Empty cores list
676-
exitCode, d = executeWithArgs("core", "list")
677-
require.Zero(t, exitCode)
678-
require.Empty(t, strings.TrimSpace(string(d)))
679659
}

Diff for: cli/serial/serial.go

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2019 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to modify or
12+
// otherwise use the software for commercial activities involving the Arduino
13+
// software without disclosing the source code of your own applications. To purchase
14+
// a commercial license, send an email to [email protected].
15+
16+
package serial
17+
18+
import (
19+
"os"
20+
21+
"github.com/spf13/cobra"
22+
)
23+
24+
// InitCommand prepares the command.
25+
func InitCommand() *cobra.Command {
26+
serialCommand := &cobra.Command{
27+
Use: "serial",
28+
Short: "Arduino CLI Serial Commands.",
29+
Long: "Arduino CLI Serial Commands.",
30+
Example: " " + os.Args[0] + " serial monitor /dev/tty0",
31+
}
32+
33+
return serialCommand
34+
}

0 commit comments

Comments
 (0)