Skip to content

Commit 7d7a177

Browse files
ported sketch with merged sketch and bootloader from legacy into integration test
1 parent c8d1195 commit 7d7a177

File tree

12 files changed

+30
-212
lines changed

12 files changed

+30
-212
lines changed
17.1 MB
Binary file not shown.

Diff for: internal/integrationtest/compile_4/compile_test.go

+27-1
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,6 @@ func testBuilderSketchWithFastledsLibrary(t *testing.T, env *integrationtest.Env
775775
})
776776
}
777777

778-
779778
type builderOutput struct {
780779
CompilerOut string `json:"compiler_out"`
781780
CompilerErr string `json:"compiler_err"`
@@ -928,3 +927,30 @@ func TestCoreCaching(t *testing.T) {
928927
require.NoError(t, err)
929928
require.NotEqual(t, coreStatBefore.ModTime(), coreStatAfterTouch.ModTime())
930929
}
930+
931+
func TestMergeSketchWithBootloader(t *testing.T) {
932+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
933+
defer env.CleanUp()
934+
935+
sketchPath, err := paths.New("testdata", "SketchWithMergedSketchAndBootloader").Abs()
936+
require.NoError(t, err)
937+
938+
// Install Arduino AVR Boards
939+
_, _, err = cli.Run("core", "install", "arduino:[email protected]")
940+
require.NoError(t, err)
941+
942+
buildPath, err := paths.MkTempDir("", "arduino-integration-test")
943+
require.NoError(t, err)
944+
defer buildPath.RemoveAll()
945+
946+
// Build first time
947+
_, _, err = cli.Run("compile", "-b", "arduino:avr:uno", "--build-path", buildPath.String(), sketchPath.String())
948+
require.NoError(t, err)
949+
950+
bytes, err := buildPath.Join("SketchWithMergedSketchAndBootloader.ino.with_bootloader.hex").ReadFile()
951+
require.NoError(t, err)
952+
mergedSketchHex := string(bytes)
953+
954+
require.Contains(t, mergedSketchHex, ":100000000C9434000C9446000C9446000C9446006A\n")
955+
require.True(t, strings.HasSuffix(mergedSketchHex, ":00000001FF\n"))
956+
}

Diff for: legacy/builder/test/sketch1/sketch1.ino renamed to internal/integrationtest/compile_4/testdata/SketchWithMergedSketchAndBootloader/SketchWithMergedSketchAndBootloader.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ void setup() {
44

55
void loop() {
66

7-
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#define TRUE FALSE
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
String hello() {
22
return "world";
3-
}
3+
}

Diff for: legacy/builder/test/merge_sketch_with_bootloader_test.go

-208
This file was deleted.

Diff for: legacy/builder/test/sketch1/header.h

-1
This file was deleted.

0 commit comments

Comments
 (0)