Skip to content

Commit

Permalink
rename pkgName to gnoPkgPath
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Jul 4, 2023
1 parent efa19d1 commit ded4971
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func execBuild(cfg *buildCfg, args []string, io *commands.IO) error {
return flag.ErrHelp
}

paths, err := gnoPackagePathsFromArgs(args)
paths, err := gnoPackagesFromArgs(args)
if err != nil {
return fmt.Errorf("list packages: %w", err)
}
Expand Down
10 changes: 5 additions & 5 deletions gnovm/cmd/gno/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func execTest(cfg *testCfg, args []string, io *commands.IO) error {
cfg.rootDir = guessRootDir()
}

pkgPaths, err := gnoPackagePathsFromArgs(args)
pkgPaths, err := gnoPackagesFromArgs(args)
if err != nil {
return fmt.Errorf("list packages from args: %w", err)
}
Expand Down Expand Up @@ -266,16 +266,16 @@ func gnoTestPkg(

// testing with *_test.gno
if len(unittestFiles) > 0 {
// TODO not pkgName, bc it's usually the last part of the pkgPath
pkgName := strings.TrimPrefix(pkgPath, "./examples/")
memPkg := gno.ReadMemPackage(pkgPath, pkgName)
// FIXME: read gnoPkgPath from gno.mod when ready
gnoPkgPath := strings.TrimPrefix(pkgPath, "./examples/")
memPkg := gno.ReadMemPackage(pkgPath, gnoPkgPath)

// tfiles, ifiles := gno.ParseMemPackageTests(memPkg)
tfiles, ifiles := parseMemPackageTests(memPkg)

// run test files in pkg
{
m := tests.TestMachine(testStore, stdout, pkgName)
m := tests.TestMachine(testStore, stdout, gnoPkgPath)
if printRuntimeMetrics {
// from tm2/pkg/sdk/vm/keeper.go
// XXX: make maxAllocTx configurable.
Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func gnoFilesFromArgs(args []string) ([]string, error) {
return paths, nil
}

func gnoPackagePathsFromArgs(args []string) ([]string, error) {
func gnoPackagesFromArgs(args []string) ([]string, error) {
paths := []string{}
for _, arg := range args {
info, err := os.Stat(arg)
Expand Down

0 comments on commit ded4971

Please sign in to comment.