Skip to content

Commit 94fad12

Browse files
committed
testing: HOL-Light: add support for cross-proofing
This commit introduces two new flags to the hol_light command of the tests script. The first allows user specification of which architecture to run/list the proofs for and the second allows for entering the nix cross-compilation devshell for that architecture. If either are not passed, the behavior is unchanged. Signed-off-by: Andreas Hatziiliou <andreas.hatziiliou@savoirfairelinux.com>
1 parent 4165ea0 commit 94fad12

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

scripts/tests

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,9 @@ class Tests:
10171017

10181018
def hol_light(self):
10191019

1020-
if platform.machine().lower() in ["arm64", "aarch64"]:
1020+
if self.args.arch:
1021+
arch = self.args.arch
1022+
elif platform.machine().lower() in ["arm64", "aarch64"]:
10211023
arch = "aarch64"
10221024
elif platform.machine().lower() in ["x86_64"]:
10231025
arch = "x86_64"
@@ -1050,12 +1052,14 @@ class Tests:
10501052
os.remove(os.path.join(proof_dir, proof_target))
10511053
except FileNotFoundError:
10521054
pass
1055+
1056+
make_cmd = [
1057+
"make",
1058+
f"mlkem/{func}.correct",
1059+
]
1060+
10531061
p = subprocess.run(
1054-
[
1055-
"make",
1056-
f"mlkem/{func}.correct",
1057-
]
1058-
+ self.make_j(),
1062+
make_cmd,
10591063
cwd="proofs/hol_light/" + arch,
10601064
env=os.environ.copy(),
10611065
capture_output=(self.args.verbose is False),
@@ -1481,6 +1485,14 @@ def cli():
14811485
default=False,
14821486
)
14831487

1488+
hol_light_parser.add_argument(
1489+
"-a",
1490+
"--arch",
1491+
help="Architecture for which to list/run HOL_LIGHT proofs (aarch64 or x86_64).",
1492+
choices=["aarch64", "x86_64"],
1493+
default=None,
1494+
)
1495+
14841496
# func arguments
14851497
func_parser = cmd_subparsers.add_parser(
14861498
"func",

0 commit comments

Comments
 (0)