@@ -21,6 +21,7 @@ import (
2121 "encoding/json"
2222 "fmt"
2323 "os"
24+ "regexp"
2425 "sort"
2526 "strings"
2627 "testing"
@@ -830,8 +831,17 @@ func TestCompileWithArchivesAndLongPaths(t *testing.T) {
830831 sketchPath := paths .New (libOutput )
831832 sketchPath = sketchPath .Join ("examples" , "ArduinoIoTCloud-Advanced" )
832833
833- _ , _ , err = cli .Run ("compile" , "-b" , "esp8266:esp8266:huzzah" , sketchPath .String (), "--config-file" , "arduino-cli.yaml" )
834- require .NoError (t , err )
834+ t .Run ("Compile" , func (t * testing.T ) {
835+ _ , _ , err = cli .Run ("compile" , "-b" , "esp8266:esp8266:huzzah" , sketchPath .String (), "--config-file" , "arduino-cli.yaml" )
836+ require .NoError (t , err )
837+ })
838+
839+ t .Run ("CheckCachingOfFolderArchives" , func (t * testing.T ) {
840+ // Run compile again and check if the archive is re-used (cached)
841+ out , _ , err := cli .Run ("compile" , "-b" , "esp8266:esp8266:huzzah" , sketchPath .String (), "--config-file" , "arduino-cli.yaml" , "-v" )
842+ require .NoError (t , err )
843+ require .True (t , regexp .MustCompile (`(?m)^Using previously compiled file:.*libraries.ArduinoIoTCloud.objs\.a$` ).Match (out ))
844+ })
835845}
836846
837847func TestCompileWithPrecompileLibrary (t * testing.T ) {
0 commit comments