diff options
Diffstat (limited to 'tests')
l--------- | tests/benchmarks/atomic-set/main.go | 1 | ||||
-rw-r--r-- | tests/benchmarks/atomic-set/stm.go | 23 | ||||
l--------- | tests/fuzz/api/main.go | 1 | ||||
-rw-r--r-- | tests/fuzz/api/stm.go | 34 |
4 files changed, 59 insertions, 0 deletions
diff --git a/tests/benchmarks/atomic-set/main.go b/tests/benchmarks/atomic-set/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/benchmarks/atomic-set/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file diff --git a/tests/benchmarks/atomic-set/stm.go b/tests/benchmarks/atomic-set/stm.go new file mode 100644 index 0000000..24aa95d --- /dev/null +++ b/tests/benchmarks/atomic-set/stm.go @@ -0,0 +1,23 @@ +package stm + +import ( + "flag" + "time" +) + + + +var nFlag = flag.Int( + "n", + 1_000, + "The number of iterations to execute", +) + +func MainTest() { + flag.Parse() + n := *nFlag + + for i := 0; i < n; i++ { + time.Sleep(time.Millisecond * 1) + } +} diff --git a/tests/fuzz/api/main.go b/tests/fuzz/api/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/fuzz/api/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file diff --git a/tests/fuzz/api/stm.go b/tests/fuzz/api/stm.go new file mode 100644 index 0000000..70b585c --- /dev/null +++ b/tests/fuzz/api/stm.go @@ -0,0 +1,34 @@ +package stm + +import ( + "os" + "testing" + "testing/internal/testdeps" +) + + + +func api(f *testing.F) { + f.Fuzz(func(t *testing.T, n int) { + 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()) +} |