Skip to content

Commit

Permalink
chore: rename some files
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Dec 29, 2024
1 parent f9a9b2f commit c2064c0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 46 deletions.
53 changes: 53 additions & 0 deletions gno.land/pkg/integration/testdata_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package integration

import (
"os"
"strconv"
"testing"

gno_integration "github.com/gnolang/gno/gnovm/pkg/integration"
"github.com/rogpeppe/go-internal/testscript"
"github.com/stretchr/testify/require"
)

var debugTs = false

func init() { debugTs, _ = strconv.ParseBool(os.Getenv("DEBUG_TS")) }

func TestTestdata(t *testing.T) {
t.Parallel()

p := gno_integration.NewTestingParams(t, "testdata")

if coverdir, ok := gno_integration.ResolveCoverageDir(); ok {
err := gno_integration.SetupTestscriptsCoverage(&p, coverdir)
require.NoError(t, err)
}

// Set up gnoland for testscript
err := SetupGnolandTestscript(t, &p)
require.NoError(t, err)

mode := commandKindTesting
if debugTs {
mode = commandKindInMemory
}

origSetup := p.Setup
p.Setup = func(env *testscript.Env) error {
env.Values[envKeyExecCommand] = mode
if origSetup != nil {
if err := origSetup(env); err != nil {
return err
}
}

return nil
}

if debugTs {
testscript.RunT(tSeqShim{t}, p)
} else {
testscript.Run(t, p)
}
}
Original file line number Diff line number Diff line change
@@ -1,59 +1,13 @@
package integration

import (
"os"
"strconv"
"strings"
"testing"

gno_integration "github.com/gnolang/gno/gnovm/pkg/integration"
"github.com/rogpeppe/go-internal/testscript"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

var debugTs = false

func init() { debugTs, _ = strconv.ParseBool(os.Getenv("DEBUG_TS")) }

func TestTestdata(t *testing.T) {
t.Parallel()

p := gno_integration.NewTestingParams(t, "testdata")

if coverdir, ok := gno_integration.ResolveCoverageDir(); ok {
err := gno_integration.SetupTestscriptsCoverage(&p, coverdir)
require.NoError(t, err)
}

// Set up gnoland for testscript
err := SetupGnolandTestscript(t, &p)
require.NoError(t, err)

mode := commandKindTesting
if debugTs {
mode = commandKindInMemory
}

origSetup := p.Setup
p.Setup = func(env *testscript.Env) error {
env.Values[envKeyExecCommand] = mode
if origSetup != nil {
if err := origSetup(env); err != nil {
return err
}
}

return nil
}

if debugTs {
testscript.RunT(tSeqShim{t}, p)
} else {
testscript.Run(t, p)
}
}

func TestUnquote(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit c2064c0

Please sign in to comment.