Skip to content

Commit

Permalink
benchmark should write to tmp dir, not ./testdata. Fixes #42.
Browse files Browse the repository at this point in the history
  • Loading branch information
dr2chase authored and kevinburke committed Oct 6, 2021
1 parent 0d7fe26 commit 12dca65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Beyang Liu <[email protected]>
Brandon Mulcahy <[email protected]>
Chris McBride <[email protected]>
Craig Landry <[email protected]>
David Chase <[email protected]>
Dimitri Sokolyuk <[email protected]>
Dmitri Shuralyov <[email protected]>
Elazar Leibovich <[email protected]>
Expand Down
7 changes: 6 additions & 1 deletion benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ func BenchmarkBindata(b *testing.B) {
b.Fatal(err)
}
b.SetBytes(size)
outDir, err := ioutil.TempDir("", "bench_bindata")
if err != nil {
b.Fatal(err)
}
defer os.RemoveAll(outDir) // clean up
cfg := &bindata.Config{
Package: "assets",
Input: []bindata.InputConfig{
{Path: "testdata/benchmark", Recursive: true},
},
Output: "testdata/assets/bindata.go",
Output: filepath.Join(outDir, "bindata.go"),
NoMemCopy: false,
NoCompress: true,
Debug: false,
Expand Down

0 comments on commit 12dca65

Please sign in to comment.