Skip to content

Commit 88d12ef

Browse files
committed
Updated integration test
1 parent b4a05c1 commit 88d12ef

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

internal/integrationtest/compile_4/compile_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,19 +929,26 @@ func TestBuildCaching(t *testing.T) {
929929
// Find cached core and save timestamp
930930
pathList, err := buildCachePath.ReadDirRecursiveFiltered(nil, paths.FilterPrefixes("core.a"))
931931
require.NoError(t, err)
932-
require.Len(t, pathList, 1)
932+
require.Len(t, pathList, 2)
933933
cachedCoreFile := pathList[0]
934-
lastUsedPath := cachedCoreFile.Parent().Join(".last-used")
935-
require.True(t, lastUsedPath.Exist())
934+
require.True(t, cachedCoreFile.Parent().Join(".last-used").Exist())
936935
coreStatBefore, err := cachedCoreFile.Stat()
937936
require.NoError(t, err)
938937

938+
sketchCoreFile := pathList[1]
939+
require.True(t, sketchCoreFile.Parent().Parent().Join(".last-used").Exist())
940+
sketchStatBefore, err := sketchCoreFile.Stat()
941+
require.NoError(t, err)
942+
939943
// Run build again and check timestamp is unchanged
940944
_, _, err = cli.Run("compile", "-b", "arduino:avr:uno", "--build-cache-path", buildCachePath.String(), sketchPath.String())
941945
require.NoError(t, err)
942946
coreStatAfterRebuild, err := cachedCoreFile.Stat()
943947
require.NoError(t, err)
944948
require.Equal(t, coreStatBefore.ModTime(), coreStatAfterRebuild.ModTime())
949+
sketchStatAfterRebuild, err := sketchCoreFile.Stat()
950+
require.NoError(t, err)
951+
require.Equal(t, sketchStatBefore.ModTime(), sketchStatAfterRebuild.ModTime())
945952

946953
// Touch a file of the core and check if the builder invalidate the cache
947954
time.Sleep(time.Second)

0 commit comments

Comments
 (0)