Skip to content

Archive compiled core and use on subsequent compilations #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 20, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove TestWipeoutBuildPathIfBuildOptionsChangedBuildOptionsMatch test
Build options json is not the optimal way to discover if something has changed in the build. Commit 19751fe#diff-f796a16acff0c78b88ffe6618745edc6R67 enforces the check and also wipes if the core has changed "in place".

Wiping more often gives better confidence that the actual compliation results reflect the backing storage situation.
  • Loading branch information
facchinm committed Mar 17, 2017
commit 1125e5380ec2f6480b64c662eafc74dbe2bef8a4
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
package test

import (
"os"
"path/filepath"
"testing"

"arduino.cc/builder"
"arduino.cc/builder/gohasissues"
"arduino.cc/builder/types"
"arduino.cc/builder/utils"
"github.com/stretchr/testify/require"
"os"
"path/filepath"
"testing"
)

func TestWipeoutBuildPathIfBuildOptionsChanged(t *testing.T) {
Expand Down Expand Up @@ -100,34 +101,3 @@ func TestWipeoutBuildPathIfBuildOptionsChangedNoPreviousBuildOptions(t *testing.
_, err = os.Stat(filepath.Join(buildPath, "should_not_be_deleted.txt"))
NoError(t, err)
}

func TestWipeoutBuildPathIfBuildOptionsChangedBuildOptionsMatch(t *testing.T) {
ctx := &types.Context{}

buildPath := SetupBuildPath(t, ctx)
defer os.RemoveAll(buildPath)

ctx.BuildOptionsJsonPrevious = "{ \"old\":\"old\" }"
ctx.BuildOptionsJson = "{ \"old\":\"old\" }"

utils.TouchFile(filepath.Join(buildPath, "should_not_be_deleted.txt"))

commands := []types.Command{
&builder.WipeoutBuildPathIfBuildOptionsChanged{},
}

for _, command := range commands {
err := command.Run(ctx)
NoError(t, err)
}

_, err := os.Stat(buildPath)
NoError(t, err)

files, err := gohasissues.ReadDir(buildPath)
NoError(t, err)
require.Equal(t, 1, len(files))

_, err = os.Stat(filepath.Join(buildPath, "should_not_be_deleted.txt"))
NoError(t, err)
}