Skip to content
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

feat: fix gno test for _test.gno and _filetest.gno files #945

Merged
merged 20 commits into from
Aug 10, 2023
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
Next Next commit
fix gno test failing tests
harry-hov committed Jul 11, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 07cc84230394962b9dc940d2e95b9d3f20120795
43 changes: 22 additions & 21 deletions gnovm/cmd/gno/test_test.go
Original file line number Diff line number Diff line change
@@ -10,19 +10,20 @@ func TestTest(t *testing.T) {
},
{
args: []string{"test", "../../../examples/gno.land/p/demo/rand"},
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/rand \t",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/rand \t",
},
{
args: []string{"test", "../../tests/integ/no-such-dir"},
errShouldContain: "no such file or directory",
},
{
args: []string{"test", "../../tests/integ/empty-dir"},
args: []string{"test", "../../tests/integ/empty-dir"},
stderrShouldContain: "? ../../tests/integ/empty-dir \t[no test files]",
},
{
// FIXME: should have an output
args: []string{"test", "../../tests/integ/minimalist-gno1"},
stderrShouldBe: "? ./../../tests/integ/minimalist-gno1 \t[no test files]\n",
stderrShouldBe: "? ../../tests/integ/minimalist-gno1 \t[no test files]\n",
},
{
args: []string{"test", "../../tests/integ/minimalist-gno2"},
@@ -46,7 +47,7 @@ func TestTest(t *testing.T) {
},
{
args: []string{"test", "../../tests/integ/empty-gno1"},
stderrShouldBe: "? ./../../tests/integ/empty-gno1 \t[no test files]\n",
stderrShouldBe: "? ../../tests/integ/empty-gno1 \t[no test files]\n",
},
{
args: []string{"test", "--precompile", "../../tests/integ/empty-gno1"},
@@ -90,82 +91,82 @@ func TestTest(t *testing.T) {
},
{
args: []string{"test", "--verbose", "--precompile", "../../tests/integ/failing2"},
stderrShouldBe: "=== PREC ./../../tests/integ/failing2\n=== BUILD ./../../tests/integ/failing2\n=== RUN file/failing_filetest.gno\n",
stderrShouldBe: "=== PREC ../../tests/integ/failing2\n=== BUILD ../../tests/integ/failing2\n=== RUN file/failing_filetest.gno\n",
recoverShouldBe: "fail on ../../tests/integ/failing2/failing_filetest.gno: got unexpected error: beep boop",
},
{
args: []string{"test", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--run", ".*", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--run", "NoExists", "../../../examples/gno.land/p/demo/ufmt"},
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--run", ".*/hello", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--run", ".*/hi", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--run", ".*/NoExists", "../../../examples/gno.land/p/demo/ufmt"},
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--run", ".*/hello/NoExists", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--run", "Sprintf/", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--run", "Sprintf/.*", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--run", "Sprintf/hello", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "--timeout", "1000000s", "../../../examples/gno.land/p/demo/ufmt"},
stdoutShouldContain: "RUN TestSprintf",
stderrShouldContain: "ok ./../../../examples/gno.land/p/demo/ufmt",
stderrShouldContain: "ok ../../../examples/gno.land/p/demo/ufmt",
},
{
args: []string{"test", "--verbose", "../../tests/integ/native-lib"},
recoverShouldContain: "./../../tests/integ/native-lib/contract.gno:1: unknown import path net",
recoverShouldContain: "../../tests/integ/native-lib/contract.gno:1: unknown import path net",
},
{
args: []string{"test", "--verbose", "--with-native-fallback", "../../tests/integ/native-lib"},
stderrShouldContain: "ok ./../../tests/integ/native-lib",
stderrShouldContain: "ok ../../tests/integ/native-lib",
},
{
args: []string{"test", "--verbose", "../../tests/integ/unknown-lib"},
recoverShouldContain: "./../../tests/integ/unknown-lib/contract.gno:1: unknown import path foobarbaz",
recoverShouldContain: "../../tests/integ/unknown-lib/contract.gno:1: unknown import path foobarbaz",
},
{
args: []string{"test", "--verbose", "--with-native-fallback", "../../tests/integ/unknown-lib"},
recoverShouldContain: "./../../tests/integ/unknown-lib/contract.gno:1: unknown import path foobarbaz",
recoverShouldContain: "../../tests/integ/unknown-lib/contract.gno:1: unknown import path foobarbaz",
},
{
args: []string{"test", "--verbose", "--print-runtime-metrics", "../../../examples/gno.land/p/demo/ufmt"},