Skip to content

Commit c898e3e

Browse files
Migrate TestCompileWithCustomLibraries from test_compile_part_2.py to compile_part_2_test.go
1 parent 979f7a7 commit c898e3e

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

internal/integrationtest/compile/compile_part_2_test.go

+26
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,29 @@ func TestCompileWithInvalidUrl(t *testing.T) {
268268
expectedIndexfile := cli.DataDir().Join("package_example_index.json")
269269
require.Contains(t, string(stderr), "loading json index file "+expectedIndexfile.String()+": open "+expectedIndexfile.String()+":")
270270
}
271+
272+
func TestCompileWithCustomLibraries(t *testing.T) {
273+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
274+
defer env.CleanUp()
275+
276+
// Creates config with additional URL to install necessary core
277+
url := "http://arduino.esp8266.com/stable/package_esp8266com_index.json"
278+
_, _, err := cli.Run("config", "init", "--dest-dir", ".", "--additional-urls", url)
279+
require.NoError(t, err)
280+
281+
// Init the environment explicitly
282+
_, _, err = cli.Run("update")
283+
require.NoError(t, err)
284+
285+
_, _, err = cli.Run("core", "install", "esp8266:esp8266")
286+
require.NoError(t, err)
287+
288+
sketchName := "sketch_with_multiple_custom_libraries"
289+
sketchPath := cli.CopySketch(sketchName)
290+
fqbn := "esp8266:esp8266:nodemcu:xtal=80,vt=heap,eesz=4M1M,wipe=none,baud=115200"
291+
292+
firstLib := sketchPath.Join("libraries1")
293+
secondLib := sketchPath.Join("libraries2")
294+
_, _, err = cli.Run("compile", "--libraries", firstLib.String(), "--libraries", secondLib.String(), "-b", fqbn, sketchPath.String())
295+
require.NoError(t, err)
296+
}
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)