Remove ScriptTest.cpp, replace with test_conflict_set.py

CC #23
This commit is contained in:
2024-04-17 11:29:44 -07:00
parent fd93300ce8
commit 717f9d6829
10 changed files with 35 additions and 1006 deletions

View File

@@ -10,3 +10,31 @@ def test_conflict_set():
assert cs.check(read(0, key)) == [Result.CONFLICT]
cs.setOldestVersion(1)
assert cs.check(read(0, key)) == [Result.TOO_OLD]
if __name__ == "__main__":
# budget "pytest" for ctest integration without pulling in a dependency. You can of course still use pytest in local development.
import argparse
import inspect
import sys
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest="command")
list_parser = subparsers.add_parser("list")
test_parser = subparsers.add_parser("test")
test_parser.add_argument("test")
args = parser.parse_args()
if args.command == "list":
sys.stdout.write(
";".join(
name[5:]
for name in dir()
if name.startswith("test_")
and inspect.isfunction(getattr(sys.modules[__name__], name))
)
)
elif args.command == "test":
globals()["test_" + args.test]()