Skip to content

Commit

Permalink
remove emptyness test, it depends on the state of the machine running…
Browse files Browse the repository at this point in the history
… the tests
  • Loading branch information
masci committed Jul 17, 2019
1 parent 18d9529 commit ca12012
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
20 changes: 0 additions & 20 deletions cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"
"testing"

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

// Empty cores list
exitCode, _ := executeWithArgs("--config-file", configFile, "core", "list")
require.Zero(t, exitCode)

// Dump config with cmd-line specific file
exitCode, d := executeWithArgs("--config-file", configFile, "config", "dump")
require.Zero(t, exitCode)
Expand All @@ -556,11 +551,6 @@ board_manager:
// Update inexistent index
exitCode, _ = executeWithArgs("--config-file", configFile, "core", "update-index")
require.NotZero(t, exitCode)

// Empty cores list
exitCode, d = executeWithArgs("--config-file", configFile, "core", "list")
require.Zero(t, exitCode)
require.Empty(t, strings.TrimSpace(string(d)))
}

func TestCoreCommandsIntegration(t *testing.T) {
Expand Down Expand Up @@ -601,11 +591,6 @@ func TestCoreCommandsIntegration(t *testing.T) {
require.NotZero(t, exitCode)
require.Contains(t, string(d), "invalid item")

// Empty cores list
exitCode, d = executeWithArgs("core", "list")
require.Zero(t, exitCode)
require.Empty(t, strings.TrimSpace(string(d)))

// Install avr 1.6.16
exitCode, d = executeWithArgs("core", "install", "arduino:[email protected]")
require.Zero(t, exitCode)
Expand Down Expand Up @@ -671,9 +656,4 @@ func TestCoreCommandsIntegration(t *testing.T) {
exitCode, d = executeWithArgs("core", "uninstall", "arduino:avr")
require.Zero(t, exitCode)
require.Contains(t, string(d), AVR+" uninstalled")

// Empty cores list
exitCode, d = executeWithArgs("core", "list")
require.Zero(t, exitCode)
require.Empty(t, strings.TrimSpace(string(d)))
}
34 changes: 34 additions & 0 deletions cli/serial/serial.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// This file is part of arduino-cli.
//
// Copyright 2019 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to modify or
// otherwise use the software for commercial activities involving the Arduino
// software without disclosing the source code of your own applications. To purchase
// a commercial license, send an email to [email protected].

package serial

import (
"os"

"github.com/spf13/cobra"
)

// InitCommand prepares the command.
func InitCommand() *cobra.Command {
serialCommand := &cobra.Command{
Use: "serial",
Short: "Arduino CLI Serial Commands.",
Long: "Arduino CLI Serial Commands.",
Example: " " + os.Args[0] + " serial monitor /dev/tty0",
}

return serialCommand
}

0 comments on commit ca12012

Please sign in to comment.