Skip to content

Commit 673b515

Browse files
Migrate TestCompileWithCustomLibraries from test_compile_part_2.py to compile_part_2_test.go
1 parent f39f146 commit 673b515

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

internal/integrationtest/compile/compile_part_2_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,29 @@ func TestCompileWithInvalidUrl(t *testing.T) {
259259
expectedIndexfile := cli.DataDir().Join("package_example_index.json")
260260
require.Contains(t, string(stderr), "loading json index file "+expectedIndexfile.String()+": open "+expectedIndexfile.String()+":")
261261
}
262+
263+
func TestCompileWithCustomLibraries(t *testing.T) {
264+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
265+
defer env.CleanUp()
266+
267+
// Creates config with additional URL to install necessary core
268+
url := "http://arduino.esp8266.com/stable/package_esp8266com_index.json"
269+
_, _, err := cli.Run("config", "init", "--dest-dir", ".", "--additional-urls", url)
270+
require.NoError(t, err)
271+
272+
// Init the environment explicitly
273+
_, _, err = cli.Run("update")
274+
require.NoError(t, err)
275+
276+
_, _, err = cli.Run("core", "install", "esp8266:esp8266")
277+
require.NoError(t, err)
278+
279+
sketchName := "sketch_with_multiple_custom_libraries"
280+
sketchPath := cli.CopySketch(sketchName)
281+
fqbn := "esp8266:esp8266:nodemcu:xtal=80,vt=heap,eesz=4M1M,wipe=none,baud=115200"
282+
283+
firstLib := sketchPath.Join("libraries1")
284+
secondLib := sketchPath.Join("libraries2")
285+
_, _, err = cli.Run("compile", "--libraries", firstLib.String(), "--libraries", secondLib.String(), "-b", fqbn, sketchPath.String())
286+
require.NoError(t, err)
287+
}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#include "lib1.h"
2-
#include "lib2.h"
3-
4-
void setup() {
5-
}
6-
7-
void loop() {
8-
}
1+
#include "lib1.h"
2+
#include "lib2.h"
3+
4+
void setup() {
5+
}
6+
7+
void loop() {
8+
}

0 commit comments

Comments
 (0)