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 4, 2023
1 parent 1fda6db commit 5a9be69
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions internal/integrationtest/compile_4/compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"cmp"
"encoding/json"
"os/exec"
"regexp"
"slices"
"strings"
"testing"
Expand Down Expand Up @@ -956,6 +957,23 @@ func TestBuildCaching(t *testing.T) {
require.NoError(t, err)
require.NotEqual(t, coreStatBefore.ModTime(), coreStatAfterTouch.ModTime())
})

t.Run("LibraryCacheWithDifferentDirname", func(t *testing.T) {
_, _, err = cli.Run("lib", "install", "Robot IR Remote")
require.NoError(t, err)

// Run first compile
sketchPath, err := paths.New("testdata", "SketchUsingRobotIRRemote").Abs()
require.NoError(t, err)
_, _, err = cli.Run("compile", "-b", "arduino:avr:robotControl", "-v", sketchPath.String())
require.NoError(t, err)

// Run second compile and check that previous build is re-used
out, _, err := cli.Run("compile", "-b", "arduino:avr:robotControl", "-v", sketchPath.String())
require.NoError(t, err)
check := regexp.MustCompile(`(?m)^Using previously compiled file:.*IRremoteTools\.cpp\.o$`)
require.True(t, check.Match(out))
})
}

func TestMergeSketchWithBootloader(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <RobotIRremote.h>

void setup() {
}

void loop() {
}

0 comments on commit 5a9be69

Please sign in to comment.