@@ -929,19 +929,26 @@ func TestBuildCaching(t *testing.T) {
929
929
// Find cached core and save timestamp
930
930
pathList , err := buildCachePath .ReadDirRecursiveFiltered (nil , paths .FilterPrefixes ("core.a" ))
931
931
require .NoError (t , err )
932
- require .Len (t , pathList , 1 )
932
+ require .Len (t , pathList , 2 )
933
933
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 ())
936
935
coreStatBefore , err := cachedCoreFile .Stat ()
937
936
require .NoError (t , err )
938
937
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
+
939
943
// Run build again and check timestamp is unchanged
940
944
_ , _ , err = cli .Run ("compile" , "-b" , "arduino:avr:uno" , "--build-cache-path" , buildCachePath .String (), sketchPath .String ())
941
945
require .NoError (t , err )
942
946
coreStatAfterRebuild , err := cachedCoreFile .Stat ()
943
947
require .NoError (t , err )
944
948
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 ())
945
952
946
953
// Touch a file of the core and check if the builder invalidate the cache
947
954
time .Sleep (time .Second )
0 commit comments