Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d1a9d53

Browse filesBrowse files
committed
Added integration test
1 parent d434fc6 commit d1a9d53
Copy full SHA for d1a9d53

File tree

Expand file treeCollapse file tree

1 file changed

+45
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+45
-0
lines changed
+45Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package compile
2+
3+
import (
4+
"testing"
5+
6+
"github.com/arduino/arduino-cli/internal/integrationtest"
7+
"github.com/arduino/go-paths-helper"
8+
"github.com/stretchr/testify/require"
9+
)
10+
11+
func TestBuildCacheLibWithNonASCIIChars(t *testing.T) {
12+
// See: https://github.com/arduino/arduino-cli/issues/2671
13+
14+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
15+
t.Cleanup(env.CleanUp)
16+
17+
tmpUserDir, err := paths.MkTempDir("", "Håkan")
18+
require.NoError(t, err)
19+
t.Cleanup(func() { tmpUserDir.RemoveAll() })
20+
customEnv := cli.GetDefaultEnv()
21+
customEnv["ARDUINO_DIRECTORIES_USER"] = tmpUserDir.String()
22+
23+
// Install Arduino AVR Boards and Servo lib
24+
_, _, err = cli.Run("core", "install", "arduino:avr@1.8.6")
25+
require.NoError(t, err)
26+
_, _, err = cli.RunWithCustomEnv(customEnv, "lib", "install", "Servo")
27+
require.NoError(t, err)
28+
29+
// Make a temp sketch
30+
sketchDir := tmpUserDir.Join("ServoSketch")
31+
sketchFile := sketchDir.Join("ServoSketch.ino")
32+
require.NoError(t, sketchDir.Mkdir())
33+
require.NoError(t, sketchFile.WriteFile(
34+
[]byte("#include <Servo.h>\nvoid setup() {}\nvoid loop() {}\n"),
35+
))
36+
37+
// Compile sketch
38+
_, _, err = cli.RunWithCustomEnv(customEnv, "compile", "-b", "arduino:avr:uno", sketchFile.String())
39+
require.NoError(t, err)
40+
41+
// Compile sketch again
42+
out, _, err := cli.RunWithCustomEnv(customEnv, "compile", "-b", "arduino:avr:uno", "-v", sketchFile.String())
43+
require.NoError(t, err)
44+
require.Contains(t, string(out), "Compiling library \"Servo\"\nUsing previously compiled file")
45+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.