diff options
author | EuAndreh <eu@euandre.org> | 2024-11-03 10:15:49 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-11-19 19:10:45 -0300 |
commit | 6c4eb1aa31b670d32910d4881b0801eac8265057 (patch) | |
tree | 85fc6f0615fb503317da6782d073fa127bc71e60 /tests | |
parent | Add byte position to nodes of a syntax tree (diff) | |
download | cotia-6c4eb1aa31b670d32910d4881b0801eac8265057.tar.gz cotia-6c4eb1aa31b670d32910d4881b0801eac8265057.tar.xz |
Setup Makefile project structure with empty src/urubu.go source
Diffstat (limited to 'tests')
l--------- | tests/benchmarks/never-matching-lexer/main.go | 1 | ||||
-rw-r--r-- | tests/benchmarks/never-matching-lexer/urubu.go | 24 | ||||
-rwxr-xr-x | tests/cli-opts.sh | 0 | ||||
l--------- | tests/functional/json/main.go | 1 | ||||
-rw-r--r-- | tests/functional/json/urubu.go | 5 | ||||
l--------- | tests/fuzz/api-check/main.go | 1 | ||||
-rw-r--r-- | tests/fuzz/api-check/urubu.go | 35 | ||||
l--------- | tests/fuzz/generated-lexer-check/main.go | 1 | ||||
-rw-r--r-- | tests/fuzz/generated-lexer-check/urubu.go | 35 | ||||
l--------- | tests/fuzz/generated-parser-check/main.go | 1 | ||||
-rw-r--r-- | tests/fuzz/generated-parser-check/urubu.go | 35 | ||||
-rwxr-xr-x | tests/integration.sh | 0 | ||||
-rw-r--r-- | tests/main.go | 7 | ||||
-rw-r--r-- | tests/urubu.go | 6 |
14 files changed, 152 insertions, 0 deletions
diff --git a/tests/benchmarks/never-matching-lexer/main.go b/tests/benchmarks/never-matching-lexer/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/benchmarks/never-matching-lexer/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file diff --git a/tests/benchmarks/never-matching-lexer/urubu.go b/tests/benchmarks/never-matching-lexer/urubu.go new file mode 100644 index 0000000..9186769 --- /dev/null +++ b/tests/benchmarks/never-matching-lexer/urubu.go @@ -0,0 +1,24 @@ +package urubu + +import ( + "flag" + "time" +) + + + +var nFlag = flag.Int( + "n", + 1_000, + "The number of iterations to execute", +) + +func MainTest() { + // FIXME + flag.Parse() + n := *nFlag + + for i := 0; i < n; i++ { + time.Sleep(time.Millisecond * 1) + } +} diff --git a/tests/cli-opts.sh b/tests/cli-opts.sh new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/tests/cli-opts.sh diff --git a/tests/functional/json/main.go b/tests/functional/json/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/functional/json/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file diff --git a/tests/functional/json/urubu.go b/tests/functional/json/urubu.go new file mode 100644 index 0000000..7a40ac0 --- /dev/null +++ b/tests/functional/json/urubu.go @@ -0,0 +1,5 @@ +package urubu + +func MainTest() { + // FIXME +} diff --git a/tests/fuzz/api-check/main.go b/tests/fuzz/api-check/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/fuzz/api-check/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file diff --git a/tests/fuzz/api-check/urubu.go b/tests/fuzz/api-check/urubu.go new file mode 100644 index 0000000..7ba1c2f --- /dev/null +++ b/tests/fuzz/api-check/urubu.go @@ -0,0 +1,35 @@ +package urubu + +import ( + "os" + "testing" + "testing/internal/testdeps" +) + + + +func api(f *testing.F) { + f.Fuzz(func(t *testing.T, n int) { + // FIXME + if n > 1 { + if n < 2 { + t.Errorf("Failed n: %v\n", n) + } + } + }) +} + + + +func MainTest() { + fuzzTargets := []testing.InternalFuzzTarget{ + { "api", api }, + } + + deps := testdeps.TestDeps{} + tests := []testing.InternalTest {} + benchmarks := []testing.InternalBenchmark{} + examples := []testing.InternalExample {} + m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples) + os.Exit(m.Run()) +} diff --git a/tests/fuzz/generated-lexer-check/main.go b/tests/fuzz/generated-lexer-check/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/fuzz/generated-lexer-check/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file diff --git a/tests/fuzz/generated-lexer-check/urubu.go b/tests/fuzz/generated-lexer-check/urubu.go new file mode 100644 index 0000000..7ba1c2f --- /dev/null +++ b/tests/fuzz/generated-lexer-check/urubu.go @@ -0,0 +1,35 @@ +package urubu + +import ( + "os" + "testing" + "testing/internal/testdeps" +) + + + +func api(f *testing.F) { + f.Fuzz(func(t *testing.T, n int) { + // FIXME + if n > 1 { + if n < 2 { + t.Errorf("Failed n: %v\n", n) + } + } + }) +} + + + +func MainTest() { + fuzzTargets := []testing.InternalFuzzTarget{ + { "api", api }, + } + + deps := testdeps.TestDeps{} + tests := []testing.InternalTest {} + benchmarks := []testing.InternalBenchmark{} + examples := []testing.InternalExample {} + m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples) + os.Exit(m.Run()) +} diff --git a/tests/fuzz/generated-parser-check/main.go b/tests/fuzz/generated-parser-check/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/fuzz/generated-parser-check/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file diff --git a/tests/fuzz/generated-parser-check/urubu.go b/tests/fuzz/generated-parser-check/urubu.go new file mode 100644 index 0000000..7ba1c2f --- /dev/null +++ b/tests/fuzz/generated-parser-check/urubu.go @@ -0,0 +1,35 @@ +package urubu + +import ( + "os" + "testing" + "testing/internal/testdeps" +) + + + +func api(f *testing.F) { + f.Fuzz(func(t *testing.T, n int) { + // FIXME + if n > 1 { + if n < 2 { + t.Errorf("Failed n: %v\n", n) + } + } + }) +} + + + +func MainTest() { + fuzzTargets := []testing.InternalFuzzTarget{ + { "api", api }, + } + + deps := testdeps.TestDeps{} + tests := []testing.InternalTest {} + benchmarks := []testing.InternalBenchmark{} + examples := []testing.InternalExample {} + m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples) + os.Exit(m.Run()) +} diff --git a/tests/integration.sh b/tests/integration.sh new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/tests/integration.sh diff --git a/tests/main.go b/tests/main.go new file mode 100644 index 0000000..02c3642 --- /dev/null +++ b/tests/main.go @@ -0,0 +1,7 @@ +package main + +import "urubu" + +func main() { + urubu.MainTest() +} diff --git a/tests/urubu.go b/tests/urubu.go new file mode 100644 index 0000000..e36fe88 --- /dev/null +++ b/tests/urubu.go @@ -0,0 +1,6 @@ +package urubu + + + +func MainTest() { +} |