Skip to content

Commit 5a9be69

Browse files
committed
Added integration test
1 parent 1fda6db commit 5a9be69

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

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

+18
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"cmp"
2121
"encoding/json"
2222
"os/exec"
23+
"regexp"
2324
"slices"
2425
"strings"
2526
"testing"
@@ -956,6 +957,23 @@ func TestBuildCaching(t *testing.T) {
956957
require.NoError(t, err)
957958
require.NotEqual(t, coreStatBefore.ModTime(), coreStatAfterTouch.ModTime())
958959
})
960+
961+
t.Run("LibraryCacheWithDifferentDirname", func(t *testing.T) {
962+
_, _, err = cli.Run("lib", "install", "Robot IR Remote")
963+
require.NoError(t, err)
964+
965+
// Run first compile
966+
sketchPath, err := paths.New("testdata", "SketchUsingRobotIRRemote").Abs()
967+
require.NoError(t, err)
968+
_, _, err = cli.Run("compile", "-b", "arduino:avr:robotControl", "-v", sketchPath.String())
969+
require.NoError(t, err)
970+
971+
// Run second compile and check that previous build is re-used
972+
out, _, err := cli.Run("compile", "-b", "arduino:avr:robotControl", "-v", sketchPath.String())
973+
require.NoError(t, err)
974+
check := regexp.MustCompile(`(?m)^Using previously compiled file:.*IRremoteTools\.cpp\.o$`)
975+
require.True(t, check.Match(out))
976+
})
959977
}
960978

961979
func TestMergeSketchWithBootloader(t *testing.T) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <RobotIRremote.h>
2+
3+
void setup() {
4+
}
5+
6+
void loop() {
7+
}

0 commit comments

Comments
 (0)