lang: Add per-test config with count maximums

Some of our special tests can only be run once per `go test` invocation.
That is, using the test -count flag will cause a guaranteed failure
since we depend on a global being initialized only once as part of that
test.

This adds a per-test config option so that a user can specify to never
run a particular test more than once. This lets us continue to use the
-count flag with the test suite, without it causing some tests to fail.
This commit is contained in:
James Shubin
2024-01-22 16:53:33 -05:00
parent f0a4a9e3c4
commit d01c168450
5 changed files with 119 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
-- CONFIG --
{
"maximum-count": 1
}
-- main.mcl --
import "test"
# one_instance_a should only produce one value, and will error if initialized twice

View File

@@ -1,3 +1,7 @@
-- CONFIG --
{
"maximum-count": 1
}
-- main.mcl --
import "test"

View File

@@ -1,3 +1,7 @@
-- CONFIG --
{
"maximum-count": 1
}
-- main.mcl --
import "test"

View File

@@ -1,3 +1,7 @@
-- CONFIG --
{
"maximum-count": 1
}
-- main.mcl --
import "test"