From 377e196d6dd7d09b204609b524bf72c4715eb878 Mon Sep 17 00:00:00 2001 From: "Thing-han, Lim" <15379156+potsrevennil@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:10:23 +0800 Subject: [PATCH] Add comments for Test_Implementations methods Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> --- scripts/lib/mlkem_test.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/scripts/lib/mlkem_test.py b/scripts/lib/mlkem_test.py index 988781a13..6ec007075 100644 --- a/scripts/lib/mlkem_test.py +++ b/scripts/lib/mlkem_test.py @@ -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, @@ -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 = {} @@ -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" @@ -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: