Skip to content

Commit

Permalink
Split off results in test_all script.
Browse files Browse the repository at this point in the history
  • Loading branch information
J08nY committed Aug 18, 2024
1 parent 8c0a788 commit b026849
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions nix/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import argparse
import json
import time
import os

from pathlib import Path

Expand Down Expand Up @@ -65,18 +66,22 @@ def wrong_options(library):
def build_library(library, version):
command = ["nix", "build", f"?submodules=1#{library}.{version}"]
result = sp.run(command, check=False)
print(f"build {library} {version} = {result.returncode}")
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 = ["./result/bin/ECTesterStandalone", "test", f"-oyml:results/{library}_{test_suite}_{version}.yml", "-q", *opts, test_suite, library]
print(" ".join(command))
command = ["./result/bin/ECTesterStandalone", "test",
f"-oyml:results/yml/{library}_{test_suite}_{version}.yml",
f"-otxt:results/txt/{library}_{test_suite}_{version}.txt",
f"-oxml:results/xml/{library}_{test_suite}_{version}.xml",
"-q", *opts, test_suite, library]
try:
result = sp.run(command, timeout=60, check=False)
print(f"{library} {test_suite} {version} = {result.returncode}")
print(f"run {library} {test_suite} {version} = {result.returncode}")
except sp.TimeoutExpired:
print(f"{library} {test_suite} {version} timed-out!")
print(f"run {library} {test_suite} {version} timed-out!")


def main():
Expand Down Expand Up @@ -125,6 +130,10 @@ def main():
else:
suites2test = [suite]

os.makedirs("results/yml/", exist_of=True)
os.makedirs("results/txt/", exist_of=True)
os.makedirs("results/xml/", exist_of=True)

for library in libraries2test:
with open(f"./nix/{library}_pkg_versions.json", "r") as f:
versions = list(json.load(f).keys())
Expand Down

0 comments on commit b026849

Please sign in to comment.