Skip to content

Commit

Permalink
Add comments for Test_Implementations methods
Browse files Browse the repository at this point in the history
Signed-off-by: Thing-han, Lim <[email protected]>
  • Loading branch information
potsrevennil committed Nov 15, 2024
1 parent 8d49b5f commit c909fed
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions scripts/lib/mlkem_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ def compile(
extra_make_envs={},
extra_make_args=[],
):
"""
opt: determine to compile/run the opt or non-opt implementation
"""
self.ts["opt" if opt else "no_opt"].compile_schemes(
extra_make_envs,
extra_make_args,
Expand All @@ -208,6 +211,15 @@ def run_scheme(
prefix: [str] = [],
extra_args: [str] = [],
) -> TypedDict:
"""
opt: determine to run the opt or non-opt implementation
actual_proc: a function for processing the actual test output into string
expect_proc: a function for comparing the actual_proc output with some desried behaviour which depends on SCHEME
prefix: cmd prefix for running the testing binaries
extra_args: extra arguments for running the testing binaries
output: {opt/no_opt: {scheme: result}}
"""
k = "opt" if opt else "no_opt"

results = {}
Expand All @@ -226,6 +238,15 @@ def run_schemes(
cmd_prefix: [str] = [],
extra_args: [str] = [],
) -> TypedDict:
"""
opt: determine to run the opt or non-opt implementation
actual_proc: a function for processing the actual test output into string
expect_proc: a function for comparing the actual_proc output with some desried behaviour which depends on SCHEME
cmd_prefix: cmd prefix for running the testing binaries
extra_args: extra arguments for running the testing binaries
output: {opt/no_opt: {scheme: result}}
"""
results = {}

k = "opt" if opt else "no_opt"
Expand Down Expand Up @@ -272,6 +293,17 @@ def test(
cmd_prefix: [str] = [],
extra_args: [str] = [],
) -> TypedDict:
"""
opt: determine to compile/run the opt or non-opt implementation
compile: compile the test binary if true
run: run the binaries and check if output is as expected if true
actual_proc: a function for processing the actual test output into string
expect_proc: a function for comparing the actual_proc output with some desried behaviour which depends on SCHEME
cmd_prefix: cmd prefix for running the testing binaries
extra_args: extra arguments for running the testing binaries
output: {opt/no_opt: {scheme: result}}
"""
if compile:
self.compile(opt, extra_make_envs, extra_make_args)
if run:
Expand Down

0 comments on commit c909fed

Please sign in to comment.