Skip to content

Commit 3496575

Browse files
Migrated TestDebuggerStarts from test_debug.py to debug_test.go
1 parent aa41d72 commit 3496575

File tree

2 files changed

+53
-23
lines changed

2 files changed

+53
-23
lines changed

Diff for: internal/integrationtest/debug/debug_test.go

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2022 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
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to [email protected].
15+
16+
package debug_test
17+
18+
import (
19+
"testing"
20+
21+
"github.com/arduino/arduino-cli/internal/integrationtest"
22+
"github.com/stretchr/testify/require"
23+
)
24+
25+
func TestDebuggerStarts(t *testing.T) {
26+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
27+
defer env.CleanUp()
28+
29+
// Init the environment explicitly
30+
_, _, err := cli.Run("core", "update-index")
31+
require.NoError(t, err)
32+
33+
// Install cores
34+
_, _, err = cli.Run("core", "install", "arduino:samd")
35+
require.NoError(t, err)
36+
37+
// Create sketch for testing
38+
sketchName := "DebuggerStartTest"
39+
sketchPath := cli.DataDir().Join(sketchName)
40+
fqbn := "arduino:samd:mkr1000"
41+
42+
_, _, err = cli.Run("sketch", "new", sketchPath.String())
43+
require.NoError(t, err)
44+
45+
// Build sketch
46+
_, _, err = cli.Run("compile", "-b", fqbn, sketchPath.String())
47+
require.NoError(t, err)
48+
49+
programmer := "atmel_ice"
50+
// Starts debugger
51+
_, _, err = cli.Run("debug", "-b", fqbn, "-P", programmer, sketchPath.String(), "--info")
52+
require.NoError(t, err)
53+
}

Diff for: test/test_debug.py

-23
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,6 @@
1616

1717
from pathlib import Path
1818

19-
20-
def test_debugger_starts(run_command, data_dir):
21-
# Init the environment explicitly
22-
assert run_command(["core", "update-index"])
23-
24-
# Install cores
25-
assert run_command(["core", "install", "arduino:samd"])
26-
27-
# Create sketch for testing
28-
sketch_name = "DebuggerStartTest"
29-
sketch_path = Path(data_dir, sketch_name)
30-
fqbn = "arduino:samd:mkr1000"
31-
32-
assert run_command(["sketch", "new", sketch_path])
33-
34-
# Build sketch
35-
assert run_command(["compile", "-b", fqbn, sketch_path])
36-
37-
programmer = "atmel_ice"
38-
# Starts debugger
39-
assert run_command(["debug", "-b", fqbn, "-P", programmer, sketch_path, "--info"])
40-
41-
4219
def test_debugger_with_pde_sketch_starts(run_command, data_dir):
4320
assert run_command(["update"])
4421

0 commit comments

Comments
 (0)