@@ -21,6 +21,7 @@ import (
21
21
"encoding/json"
22
22
"fmt"
23
23
"os"
24
+ "regexp"
24
25
"sort"
25
26
"strings"
26
27
"testing"
@@ -830,8 +831,17 @@ func TestCompileWithArchivesAndLongPaths(t *testing.T) {
830
831
sketchPath := paths .New (libOutput )
831
832
sketchPath = sketchPath .Join ("examples" , "ArduinoIoTCloud-Advanced" )
832
833
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
+ })
835
845
}
836
846
837
847
func TestCompileWithPrecompileLibrary (t * testing.T ) {
0 commit comments