Skip to content

Commit 1bedb74

Browse files
Migrate TestCompileBlacklistedSketchname from test_compile_part_1.py to compile_part_1_test.go
1 parent 1c10ffa commit 1bedb74

File tree

2 files changed

+29
-25
lines changed

2 files changed

+29
-25
lines changed

internal/integrationtest/compile/compile_part_1_test.go

+29
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,32 @@ func TestCompileWithSketchWithSymlinkSelfloop(t *testing.T) {
229229
require.Contains(t, string(stderr), "Error opening sketch:")
230230
require.Error(t, err)
231231
}
232+
233+
func TestCompileBlacklistedSketchname(t *testing.T) {
234+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
235+
defer env.CleanUp()
236+
237+
// Compile should ignore folders named `RCS`, `.git` and the likes, but
238+
// it should be ok for a sketch to be named like RCS.ino
239+
240+
// Init the environment explicitly
241+
_, _, err := cli.Run("core", "update-index")
242+
require.NoError(t, err)
243+
244+
// Install Arduino AVR Boards
245+
_, _, err = cli.Run("core", "install", "arduino:avr@1.8.3")
246+
require.NoError(t, err)
247+
248+
sketchName := "RCS"
249+
sketchPath := cli.SketchbookDir().Join(sketchName)
250+
fqbn := "arduino:avr:uno"
251+
252+
// Create a test sketch
253+
stdout, _, err := cli.Run("sketch", "new", sketchPath.String())
254+
require.NoError(t, err)
255+
require.Contains(t, string(stdout), "Sketch created in: "+sketchPath.String())
256+
257+
// Build sketch for arduino:avr:uno
258+
_, _, err = cli.Run("compile", "-b", fqbn, sketchPath.String())
259+
require.NoError(t, err)
260+
}

test/test_compile_part_1.py

-25
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,6 @@
2525
from .common import running_on_ci
2626

2727

28-
def test_compile_blacklisted_sketchname(run_command, data_dir):
29-
"""
30-
Compile should ignore folders named `RCS`, `.git` and the likes, but
31-
it should be ok for a sketch to be named like RCS.ino
32-
"""
33-
# Init the environment explicitly
34-
run_command(["core", "update-index"])
35-
36-
# Install Arduino AVR Boards
37-
run_command(["core", "install", "arduino:avr@1.8.3"])
38-
39-
sketch_name = "RCS"
40-
sketch_path = os.path.join(data_dir, sketch_name)
41-
fqbn = "arduino:avr:uno"
42-
43-
# Create a test sketch
44-
result = run_command(["sketch", "new", sketch_path])
45-
assert result.ok
46-
assert "Sketch created in: {}".format(sketch_path) in result.stdout
47-
48-
# Build sketch for arduino:avr:uno
49-
result = run_command(["compile", "-b", fqbn, sketch_path])
50-
assert result.ok
51-
52-
5328
def test_compile_without_precompiled_libraries(run_command, data_dir):
5429
# Init the environment explicitly
5530
url = "https://adafruit.github.io/arduino-board-index/package_adafruit_index.json"

0 commit comments

Comments
 (0)