Skip to content

Commit

Permalink
Refactor test_all script.
Browse files Browse the repository at this point in the history
  • Loading branch information
J08nY committed Aug 18, 2024
1 parent 656b41d commit 8c0a788
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions nix/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,22 @@ def edge_cases_options(library):
def wrong_options(library):
return default_options(library)

def build_library(library, version):
command = ["nix", "build", f"?submodules=1#{library}.{version}"]
result = sp.run(command, check=False)
return result.returncode == 0

def test_library(library, test_suite, version):
opts = base_options(library)
opts.extend(globals()[f"{test_suite.replace('-', '_')}_options"](library))
command = ["nix", "run", f"?submodules=1#{library}.{version}", "--", "test", f"-oyml:results/{library}_{test_suite}_{version}.yml", *opts, test_suite, library]
command = ["./result/bin/ECTesterStandalone", "test", f"-oyml:results/{library}_{test_suite}_{version}.yml", "-q", *opts, test_suite, library]
print(" ".join(command))
try:
sp.run(command, timeout=60)
result = sp.run(command, timeout=60, check=False)
print(f"{library} {test_suite} {version} = {result.returncode}")
except sp.TimeoutExpired:
print(f"{library} {test_suite} {version} timed-out!")


def main():
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -123,6 +129,7 @@ def main():
with open(f"./nix/{library}_pkg_versions.json", "r") as f:
versions = list(json.load(f).keys())
for version in versions:
built = build_library(library, version)
for suite in suites2test:
test_library(library, suite, version)

Expand Down

0 comments on commit 8c0a788

Please sign in to comment.