From 6c4eb1aa31b670d32910d4881b0801eac8265057 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 3 Nov 2024 10:15:49 -0300 Subject: Setup Makefile project structure with empty src/urubu.go source --- tests/benchmarks/never-matching-lexer/main.go | 1 + tests/benchmarks/never-matching-lexer/urubu.go | 24 ++++++++++++++++++ tests/cli-opts.sh | 0 tests/functional/json/main.go | 1 + tests/functional/json/urubu.go | 5 ++++ tests/fuzz/api-check/main.go | 1 + tests/fuzz/api-check/urubu.go | 35 ++++++++++++++++++++++++++ tests/fuzz/generated-lexer-check/main.go | 1 + tests/fuzz/generated-lexer-check/urubu.go | 35 ++++++++++++++++++++++++++ tests/fuzz/generated-parser-check/main.go | 1 + tests/fuzz/generated-parser-check/urubu.go | 35 ++++++++++++++++++++++++++ tests/integration.sh | 0 tests/main.go | 7 ++++++ tests/urubu.go | 6 +++++ 14 files changed, 152 insertions(+) create mode 120000 tests/benchmarks/never-matching-lexer/main.go create mode 100644 tests/benchmarks/never-matching-lexer/urubu.go create mode 100755 tests/cli-opts.sh create mode 120000 tests/functional/json/main.go create mode 100644 tests/functional/json/urubu.go create mode 120000 tests/fuzz/api-check/main.go create mode 100644 tests/fuzz/api-check/urubu.go create mode 120000 tests/fuzz/generated-lexer-check/main.go create mode 100644 tests/fuzz/generated-lexer-check/urubu.go create mode 120000 tests/fuzz/generated-parser-check/main.go create mode 100644 tests/fuzz/generated-parser-check/urubu.go create mode 100755 tests/integration.sh create mode 100644 tests/main.go create mode 100644 tests/urubu.go (limited to 'tests') 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 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 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() { +} -- cgit v1.2.3