Skip to content

Commit

Permalink
Added integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Dec 20, 2023
1 parent 8424f09 commit 3caf67d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions internal/integrationtest/compile_1/compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/json"
"fmt"
"os"
"regexp"
"sort"
"strings"
"testing"
Expand Down Expand Up @@ -830,8 +831,17 @@ func TestCompileWithArchivesAndLongPaths(t *testing.T) {
sketchPath := paths.New(libOutput)
sketchPath = sketchPath.Join("examples", "ArduinoIoTCloud-Advanced")

_, _, err = cli.Run("compile", "-b", "esp8266:esp8266:huzzah", sketchPath.String(), "--config-file", "arduino-cli.yaml")
require.NoError(t, err)
t.Run("Compile", func(t *testing.T) {
_, _, err = cli.Run("compile", "-b", "esp8266:esp8266:huzzah", sketchPath.String(), "--config-file", "arduino-cli.yaml")
require.NoError(t, err)
})

t.Run("CheckCachingOfFolderArchives", func(t *testing.T) {
// Run compile again and check if the archive is re-used (cached)
out, _, err := cli.Run("compile", "-b", "esp8266:esp8266:huzzah", sketchPath.String(), "--config-file", "arduino-cli.yaml", "-v")
require.NoError(t, err)
require.True(t, regexp.MustCompile(`(?m)^Using previously compiled file:.*libraries.ArduinoIoTCloud.objs\.a$`).Match(out))
})
}

func TestCompileWithPrecompileLibrary(t *testing.T) {
Expand Down

0 comments on commit 3caf67d

Please sign in to comment.