diff --git a/internal/cli/arguments/port.go b/internal/cli/arguments/port.go index 14f5846d80d..80df4b5c22c 100644 --- a/internal/cli/arguments/port.go +++ b/internal/cli/arguments/port.go @@ -155,3 +155,8 @@ func (p *Port) DetectFQBN(inst *rpc.Instance) (string, *rpc.Port) { } return "", nil } + +// IsPortFlagSet returns true if the port address is provided +func (p *Port) IsPortFlagSet() bool { + return p.address != "" +} diff --git a/internal/cli/arguments/sketch.go b/internal/cli/arguments/sketch.go index 4e670bab6ac..58df45e3367 100644 --- a/internal/cli/arguments/sketch.go +++ b/internal/cli/arguments/sketch.go @@ -25,7 +25,7 @@ import ( // InitSketchPath returns an instance of paths.Path pointing to sketchPath. // If sketchPath is an empty string returns the current working directory. // In both cases it warns the user if he's using deprecated files -func InitSketchPath(path string) (sketchPath *paths.Path) { +func InitSketchPath(path string, printWarnings bool) (sketchPath *paths.Path) { if path != "" { sketchPath = paths.New(path) } else { @@ -36,8 +36,10 @@ func InitSketchPath(path string) (sketchPath *paths.Path) { logrus.Infof("Reading sketch from dir: %s", wd) sketchPath = wd } - if msg := sk.WarnDeprecatedFiles(sketchPath); msg != "" { - feedback.Warning(msg) + if printWarnings { + if msg := sk.WarnDeprecatedFiles(sketchPath); msg != "" { + feedback.Warning(msg) + } } return sketchPath } diff --git a/internal/cli/board/attach.go b/internal/cli/board/attach.go index f6536991ab7..ed252b019ac 100644 --- a/internal/cli/board/attach.go +++ b/internal/cli/board/attach.go @@ -53,7 +53,7 @@ func initAttachCommand() *cobra.Command { } func runAttachCommand(path string, port *arguments.Port, fqbn string) { - sketchPath := arguments.InitSketchPath(path) + sketchPath := arguments.InitSketchPath(path, true) portAddress, portProtocol, _ := port.GetPortAddressAndProtocol(nil, "", "") newDefaults, err := sketch.SetSketchDefaults(context.Background(), &rpc.SetSketchDefaultsRequest{ diff --git a/internal/cli/compile/compile.go b/internal/cli/compile/compile.go index 4ed8ab6638e..a26a90eceb6 100644 --- a/internal/cli/compile/compile.go +++ b/internal/cli/compile/compile.go @@ -157,7 +157,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) { path = args[0] } - sketchPath := arguments.InitSketchPath(path) + sketchPath := arguments.InitSketchPath(path, true) sk, err := sketch.LoadSketch(context.Background(), &rpc.LoadSketchRequest{SketchPath: sketchPath.String()}) if err != nil { diff --git a/internal/cli/debug/debug.go b/internal/cli/debug/debug.go index 69d9ddd716c..e7001a2a8d3 100644 --- a/internal/cli/debug/debug.go +++ b/internal/cli/debug/debug.go @@ -74,7 +74,7 @@ func runDebugCommand(command *cobra.Command, args []string) { path = args[0] } - sketchPath := arguments.InitSketchPath(path) + sketchPath := arguments.InitSketchPath(path, true) sk, err := sketch.LoadSketch(context.Background(), &rpc.LoadSketchRequest{SketchPath: sketchPath.String()}) if err != nil { feedback.FatalError(err, feedback.ErrGeneric) diff --git a/internal/cli/monitor/monitor.go b/internal/cli/monitor/monitor.go index c7cdac4810a..009897e8bdb 100644 --- a/internal/cli/monitor/monitor.go +++ b/internal/cli/monitor/monitor.go @@ -27,6 +27,7 @@ import ( "time" "github.com/arduino/arduino-cli/commands/monitor" + sk "github.com/arduino/arduino-cli/commands/sketch" "github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/internal/cli/arguments" @@ -45,13 +46,14 @@ var tr = i18n.Tr // NewCommand created a new `monitor` command func NewCommand() *cobra.Command { var ( - raw bool - portArgs arguments.Port - describe bool - configs []string - quiet bool - timestamp bool - fqbn arguments.Fqbn + portArgs arguments.Port + fqbnArg arguments.Fqbn + profileArg arguments.Profile + raw bool + describe bool + configs []string + quiet bool + timestamp bool ) monitorCommand := &cobra.Command{ Use: "monitor", @@ -61,38 +63,92 @@ func NewCommand() *cobra.Command { " " + os.Args[0] + " monitor -p /dev/ttyACM0\n" + " " + os.Args[0] + " monitor -p /dev/ttyACM0 --describe", Run: func(cmd *cobra.Command, args []string) { - runMonitorCmd(&portArgs, &fqbn, configs, describe, timestamp, quiet, raw) + sketchPath := "" + if len(args) > 0 { + sketchPath = args[0] + } + runMonitorCmd(&portArgs, &fqbnArg, &profileArg, sketchPath, configs, describe, timestamp, quiet, raw) }, } portArgs.AddToCommand(monitorCommand) + profileArg.AddToCommand(monitorCommand) monitorCommand.Flags().BoolVar(&raw, "raw", false, tr("Set terminal in raw mode (unbuffered).")) monitorCommand.Flags().BoolVar(&describe, "describe", false, tr("Show all the settings of the communication port.")) monitorCommand.Flags().StringSliceVarP(&configs, "config", "c", []string{}, tr("Configure communication port settings. The format is =[,=]...")) monitorCommand.Flags().BoolVarP(&quiet, "quiet", "q", false, tr("Run in silent mode, show only monitor input and output.")) monitorCommand.Flags().BoolVar(×tamp, "timestamp", false, tr("Timestamp each incoming line.")) - fqbn.AddToCommand(monitorCommand) - monitorCommand.MarkFlagRequired("port") + fqbnArg.AddToCommand(monitorCommand) return monitorCommand } -func runMonitorCmd(portArgs *arguments.Port, fqbn *arguments.Fqbn, configs []string, describe, timestamp, quiet, raw bool) { - instance := instance.CreateAndInit() +func runMonitorCmd( + portArgs *arguments.Port, fqbnArg *arguments.Fqbn, profileArg *arguments.Profile, sketchPathArg string, + configs []string, describe, timestamp, quiet, raw bool, +) { logrus.Info("Executing `arduino-cli monitor`") if !configuration.HasConsole { quiet = true } - // TODO: Should use sketch default_port/protocol? - portAddress, portProtocol, err := portArgs.GetPortAddressAndProtocol(instance, "", "") + var ( + inst *rpc.Instance + profile *rpc.Profile + fqbn string + defaultPort, defaultProtocol string + ) + + // Flags takes maximum precedence over sketch.yaml + // If {--port --fqbn --profile} are set we ignore the profile. + // If both {--port --profile} are set we read the fqbn in the following order: profile -> default_fqbn -> discovery + // If only --port is set we read the fqbn in the following order: default_fqbn -> discovery + // If only --fqbn is set we read the port in the following order: default_port + sketchPath := arguments.InitSketchPath(sketchPathArg, false) + sketch, err := sk.LoadSketch(context.Background(), &rpc.LoadSketchRequest{SketchPath: sketchPath.String()}) + if err != nil && !portArgs.IsPortFlagSet() { + feedback.Fatal( + tr("Error getting default port from `sketch.yaml`. Check if you're in the correct sketch folder or provide the --port flag: %s", err), + feedback.ErrGeneric, + ) + } + if sketch != nil { + defaultPort, defaultProtocol = sketch.GetDefaultPort(), sketch.GetDefaultProtocol() + } + if fqbnArg.String() == "" { + if profileArg.Get() == "" { + inst, profile = instance.CreateAndInitWithProfile(sketch.GetDefaultProfile().GetName(), sketchPath) + } else { + inst, profile = instance.CreateAndInitWithProfile(profileArg.Get(), sketchPath) + } + } + if inst == nil { + inst = instance.CreateAndInit() + } + // Priority on how to retrieve the fqbn + // 1. from flag + // 2. from profile + // 3. from default_fqbn specified in the sketch.yaml + // 4. try to detect from the port + switch { + case fqbnArg.String() != "": + fqbn = fqbnArg.String() + case profile.GetFqbn() != "": + fqbn = profile.GetFqbn() + case sketch.GetDefaultFqbn() != "": + fqbn = sketch.GetDefaultFqbn() + default: + fqbn, _ = portArgs.DetectFQBN(inst) + } + + portAddress, portProtocol, err := portArgs.GetPortAddressAndProtocol(inst, defaultPort, defaultProtocol) if err != nil { feedback.FatalError(err, feedback.ErrGeneric) } enumerateResp, err := monitor.EnumerateMonitorPortSettings(context.Background(), &rpc.EnumerateMonitorPortSettingsRequest{ - Instance: instance, + Instance: inst, PortProtocol: portProtocol, - Fqbn: fqbn.String(), + Fqbn: fqbn, }) if err != nil { feedback.Fatal(tr("Error getting port settings details: %s", err), feedback.ErrGeneric) @@ -144,9 +200,9 @@ func runMonitorCmd(portArgs *arguments.Port, fqbn *arguments.Fqbn, configs []str } } portProxy, _, err := monitor.Monitor(context.Background(), &rpc.MonitorRequest{ - Instance: instance, + Instance: inst, Port: &rpc.Port{Address: portAddress, Protocol: portProtocol}, - Fqbn: fqbn.String(), + Fqbn: fqbn, PortConfiguration: configuration, }) if err != nil { diff --git a/internal/cli/upload/upload.go b/internal/cli/upload/upload.go index b17f323dc8c..4444cf1e792 100644 --- a/internal/cli/upload/upload.go +++ b/internal/cli/upload/upload.go @@ -89,7 +89,7 @@ func runUploadCommand(args []string, uploadFieldsArgs map[string]string) { if len(args) > 0 { path = args[0] } - sketchPath := arguments.InitSketchPath(path) + sketchPath := arguments.InitSketchPath(path, true) if msg := sk.WarnDeprecatedFiles(sketchPath); importDir == "" && importFile == "" && msg != "" { feedback.Warning(msg) diff --git a/internal/integrationtest/monitor/monitor_test.go b/internal/integrationtest/monitor/monitor_test.go index 0f5593cb9aa..256d8e0f8cb 100644 --- a/internal/integrationtest/monitor/monitor_test.go +++ b/internal/integrationtest/monitor/monitor_test.go @@ -21,9 +21,16 @@ import ( "testing" "github.com/arduino/arduino-cli/internal/integrationtest" + "github.com/arduino/go-paths-helper" "github.com/stretchr/testify/require" ) +// returns a reader that tells the mocked monitor to exit +func quitMonitor() io.Reader { + // tells mocked monitor to exit + return bytes.NewBufferString("QUIT\n") +} + func TestMonitorConfigFlags(t *testing.T) { env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) defer env.CleanUp() @@ -38,14 +45,8 @@ func TestMonitorConfigFlags(t *testing.T) { cli.InstallMockedSerialDiscovery(t) cli.InstallMockedSerialMonitor(t) - // Test monitor command - quit := func() io.Reader { - // tells mocked monitor to exit - return bytes.NewBufferString("QUIT\n") - } - t.Run("NoArgs", func(t *testing.T) { - stdout, _, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", "--raw") + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARG", "--raw") require.NoError(t, err) require.Contains(t, string(stdout), "Opened port: /dev/ttyARG") require.Contains(t, string(stdout), "Configuration baudrate = 9600") @@ -54,7 +55,7 @@ func TestMonitorConfigFlags(t *testing.T) { }) t.Run("BaudConfig", func(t *testing.T) { - stdout, _, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", "-c", "baudrate=115200", "--raw") + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARG", "-c", "baudrate=115200", "--raw") require.NoError(t, err) require.Contains(t, string(stdout), "Opened port: /dev/ttyARG") require.Contains(t, string(stdout), "Configuration baudrate = 115200") @@ -64,7 +65,7 @@ func TestMonitorConfigFlags(t *testing.T) { }) t.Run("BaudAndParitfyConfig", func(t *testing.T) { - stdout, _, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARG", "-c", "baudrate=115200", "-c", "parity=even", "--raw") require.NoError(t, err) require.Contains(t, string(stdout), "Opened port: /dev/ttyARG") @@ -75,16 +76,211 @@ func TestMonitorConfigFlags(t *testing.T) { }) t.Run("InvalidConfigKey", func(t *testing.T) { - _, stderr, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", + _, stderr, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARG", "-c", "baud=115200", "-c", "parity=even", "--raw") require.Error(t, err) require.Contains(t, string(stderr), "invalid port configuration: baud=115200") }) t.Run("InvalidConfigValue", func(t *testing.T) { - _, stderr, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", + _, stderr, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARG", "-c", "parity=9600", "--raw") require.Error(t, err) require.Contains(t, string(stderr), "invalid port configuration value for parity: 9600") }) } + +func TestMonitorCommandFlagsAndDefaultPortFQBNSelection(t *testing.T) { + env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) + defer env.CleanUp() + + // Install AVR platform + _, _, err := cli.Run("core", "install", "arduino:avr@1.8.6") + require.NoError(t, err) + + // Patch the Yun board to require special RTS/DTR serial configuration + f, err := cli.DataDir().Join("packages", "arduino", "hardware", "avr", "1.8.6", "boards.txt").Append() + require.NoError(t, err) + _, err = f.WriteString(` +uno.serial.disableRTS=true +uno.serial.disableDTR=false +yun.serial.disableRTS=true +yun.serial.disableDTR=true +`) + require.NoError(t, err) + require.NoError(t, f.Close()) + + // Install mocked discovery and monitor for testing + cli.InstallMockedSerialDiscovery(t) + cli.InstallMockedSerialMonitor(t) + + // Create test sketches + getSketchPath := func(sketch string) string { + p, err := paths.New("testdata", sketch).Abs() + require.NoError(t, err) + require.True(t, p.IsDir()) + return p.String() + } + sketch := getSketchPath("SketchWithNoProfiles") + sketchWithPort := getSketchPath("SketchWithDefaultPort") + sketchWithFQBN := getSketchPath("SketchWithDefaultFQBN") + sketchWithPortAndFQBN := getSketchPath("SketchWithDefaultPortAndFQBN") + + t.Run("NoFlags", func(t *testing.T) { + t.Run("NoDefaultPortNoDefaultFQBN", func(t *testing.T) { + _, stderr, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "--raw", sketch) + require.Error(t, err) + require.Contains(t, string(stderr), "No monitor available for the port protocol default") + }) + + t.Run("WithDefaultPort", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "--raw", sketchWithPort) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyDEF") + require.Contains(t, string(stdout), "Configuration rts = on") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("WithDefaultFQBN", func(t *testing.T) { + _, stderr, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "--raw", sketchWithFQBN) + require.Error(t, err) + require.Contains(t, string(stderr), "No monitor available for the port protocol default") + }) + + t.Run("WithDefaultPortAndQBN", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "--raw", sketchWithPortAndFQBN) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyDEF") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = off") + }) + + t.Run("FQBNFromSpecificProfile", func(t *testing.T) { + // The only way to assert we're picking up the fqbn specified from the profile is to provide a wrong value + _, stderr, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "--raw", "--profile", "profile1", sketchWithPortAndFQBN) + require.Error(t, err) + require.Contains(t, string(stderr), "not an FQBN: broken_fqbn") + }) + }) + + t.Run("WithPortFlag", func(t *testing.T) { + t.Run("NoDefaultPortNoDefaultFQBN", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "--raw", sketch) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARGS") + require.Contains(t, string(stdout), "Configuration rts = on") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("WithDefaultPort", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "--raw", sketchWithPort) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARGS") + require.Contains(t, string(stdout), "Configuration rts = on") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("WithDefaultFQBN", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "--raw", sketchWithFQBN) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARGS") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = off") + }) + + t.Run("WithDefaultPortAndQBN", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "--raw", sketchWithPortAndFQBN) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARGS") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = off") + }) + + t.Run("FQBNFromSpecificProfile", func(t *testing.T) { + // The only way to assert we're picking up the fqbn specified from the profile is to provide a wrong value + _, stderr, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "--raw", "--profile", "profile1", sketchWithPortAndFQBN) + require.Error(t, err) + require.Contains(t, string(stderr), "not an FQBN: broken_fqbn") + }) + }) + + t.Run("WithFQBNFlag", func(t *testing.T) { + t.Run("NoDefaultPortNoDefaultFQBN", func(t *testing.T) { + _, stderr, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-b", "arduino:avr:uno", "--raw", sketch) + require.Error(t, err) + require.Contains(t, string(stderr), "No monitor available for the port protocol default") + }) + + t.Run("WithDefaultPort", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-b", "arduino:avr:uno", "--raw", sketchWithPort) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyDEF") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("WithDefaultFQBN", func(t *testing.T) { + _, stderr, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-b", "arduino:avr:uno", "--raw", sketchWithFQBN) + require.Error(t, err) + require.Contains(t, string(stderr), "No monitor available for the port protocol default") + }) + + t.Run("WithDefaultPortAndQBN", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-b", "arduino:avr:uno", "--raw", sketchWithPortAndFQBN) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyDEF") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("IgnoreProfile", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-b", "arduino:avr:uno", "--raw", "--profile", "profile1", sketchWithPortAndFQBN) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyDEF") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + }) + + t.Run("WithPortAndFQBNFlags", func(t *testing.T) { + t.Run("NoDefaultPortNoDefaultFQBN", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "-b", "arduino:avr:uno", "--raw", sketch) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARGS") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("WithDefaultPort", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "-b", "arduino:avr:uno", "--raw", sketchWithPort) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARGS") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("WithDefaultFQBN", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "-b", "arduino:avr:uno", "--raw", sketchWithFQBN) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARGS") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("WithDefaultPortAndQBN", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "-b", "arduino:avr:uno", "--raw", sketchWithPortAndFQBN) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARGS") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("IgnoreProfile", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quitMonitor(), "monitor", "-p", "/dev/ttyARGS", "-b", "arduino:avr:uno", "--raw", "--profile", "profile1", sketchWithPortAndFQBN) + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARGS") + require.Contains(t, string(stdout), "Configuration rts = off") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + }) +} diff --git a/internal/integrationtest/monitor/testdata/SketchWithDefaultFQBN/SketchWithDefaultFQBN.ino b/internal/integrationtest/monitor/testdata/SketchWithDefaultFQBN/SketchWithDefaultFQBN.ino new file mode 100644 index 00000000000..5054c040393 --- /dev/null +++ b/internal/integrationtest/monitor/testdata/SketchWithDefaultFQBN/SketchWithDefaultFQBN.ino @@ -0,0 +1,3 @@ + +void setup() {} +void loop() {} diff --git a/internal/integrationtest/monitor/testdata/SketchWithDefaultFQBN/sketch.yaml b/internal/integrationtest/monitor/testdata/SketchWithDefaultFQBN/sketch.yaml new file mode 100644 index 00000000000..19e9541979f --- /dev/null +++ b/internal/integrationtest/monitor/testdata/SketchWithDefaultFQBN/sketch.yaml @@ -0,0 +1 @@ +default_fqbn: arduino:avr:yun diff --git a/internal/integrationtest/monitor/testdata/SketchWithDefaultPort/SketchWithDefaultPort.ino b/internal/integrationtest/monitor/testdata/SketchWithDefaultPort/SketchWithDefaultPort.ino new file mode 100644 index 00000000000..5054c040393 --- /dev/null +++ b/internal/integrationtest/monitor/testdata/SketchWithDefaultPort/SketchWithDefaultPort.ino @@ -0,0 +1,3 @@ + +void setup() {} +void loop() {} diff --git a/internal/integrationtest/monitor/testdata/SketchWithDefaultPort/sketch.yaml b/internal/integrationtest/monitor/testdata/SketchWithDefaultPort/sketch.yaml new file mode 100644 index 00000000000..5670096124c --- /dev/null +++ b/internal/integrationtest/monitor/testdata/SketchWithDefaultPort/sketch.yaml @@ -0,0 +1 @@ +default_port: /dev/ttyDEF diff --git a/internal/integrationtest/monitor/testdata/SketchWithDefaultPortAndFQBN/SketchWithDefaultPortAndFQBN.ino b/internal/integrationtest/monitor/testdata/SketchWithDefaultPortAndFQBN/SketchWithDefaultPortAndFQBN.ino new file mode 100644 index 00000000000..5054c040393 --- /dev/null +++ b/internal/integrationtest/monitor/testdata/SketchWithDefaultPortAndFQBN/SketchWithDefaultPortAndFQBN.ino @@ -0,0 +1,3 @@ + +void setup() {} +void loop() {} diff --git a/internal/integrationtest/monitor/testdata/SketchWithDefaultPortAndFQBN/sketch.yaml b/internal/integrationtest/monitor/testdata/SketchWithDefaultPortAndFQBN/sketch.yaml new file mode 100644 index 00000000000..c8549c21b99 --- /dev/null +++ b/internal/integrationtest/monitor/testdata/SketchWithDefaultPortAndFQBN/sketch.yaml @@ -0,0 +1,5 @@ +default_port: /dev/ttyDEF +default_fqbn: arduino:avr:yun +profiles: + profile1: + fqbn: "broken_fqbn" diff --git a/internal/integrationtest/monitor/testdata/SketchWithNoProfiles/SketchWithNoProfiles.ino b/internal/integrationtest/monitor/testdata/SketchWithNoProfiles/SketchWithNoProfiles.ino new file mode 100644 index 00000000000..5054c040393 --- /dev/null +++ b/internal/integrationtest/monitor/testdata/SketchWithNoProfiles/SketchWithNoProfiles.ino @@ -0,0 +1,3 @@ + +void setup() {} +void loop() {}