Skip to content

Commit

Permalink
fix TestTest
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Oct 26, 2023
1 parent 5d18e89 commit d4db3af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions gnovm/cmd/gno/precompile.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ type precompileOptions struct {
precompiled map[importPath]struct{}
}

var defaultPrecompileCfg = &precompileCfg{
verbose: false,
goBinary: "go",
}

func newPrecompileOptions(cfg *precompileCfg) *precompileOptions {
return &precompileOptions{cfg, map[importPath]struct{}{}}
}
Expand Down
7 changes: 3 additions & 4 deletions gnovm/cmd/gno/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,9 @@ func execTest(cfg *testCfg, args []string, io *commands.IO) error {
if verbose {
io.ErrPrintfln("=== PREC %s", pkg.Dir)
}
precompileCfg := &precompileCfg{
precompileOpts := newPrecompileOptions(&precompileCfg{
output: tempdirRoot,
}
precompileOpts := newPrecompileOptions(precompileCfg)
})
err := precompilePkg(importPath(pkg.Dir), precompileOpts)
if err != nil {
io.ErrPrintln(err)
Expand All @@ -232,7 +231,7 @@ func execTest(cfg *testCfg, args []string, io *commands.IO) error {
if err != nil {
return errors.New("cannot resolve build dir")
}
err = goBuildFileOrPkg(tempDir, precompileCfg)
err = goBuildFileOrPkg(tempDir, defaultPrecompileCfg)
if err != nil {
io.ErrPrintln(err)
io.ErrPrintln("FAIL")
Expand Down

0 comments on commit d4db3af

Please sign in to comment.