Skip to content

Commit

Permalink
Merge pull request #277 from pq-code-package/fix_276
Browse files Browse the repository at this point in the history
Fix quoting of CFLAGS when fwding from `tests all` to `tests func/kat/nistkat`
  • Loading branch information
hanno-becker authored Oct 30, 2024
2 parents 5aee0d6 + 00882fd commit 9b06cdc
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions scripts/tests
Original file line number Diff line number Diff line change
Expand Up @@ -669,17 +669,31 @@ def all(
compile_mode = "cross" if state.cross_prefix else "native"

def _cmd(cmd: str, compile_flag: str, run_flag: str) -> [str]:
return [
"tests",
f"{cmd}",
f"--cross-prefix={state.cross_prefix}",
*([f"--cflags={state.cflags}"] if state.cflags is not None else []),
f"--{opt_flag}",
f"--{auto_flag}",
f"--{compile_flag}",
f"--{run_flag}",
*(["--verbose"] if state.verbose else []),
]
if compile_flag == "compile":
return [
"tests",
f"{cmd}",
f"--cross-prefix={state.cross_prefix}",
*(["--cflags", state.cflags] if state.cflags is not None else []),
f"--{opt_flag}",
f"--{auto_flag}",
f"--compile",
f"--no-run",
*(["--verbose"] if state.verbose else []),
]
elif run_flag == "run":
# Omit CFLAGS here because quoting for CFLAGS breaks when there are
# multiple space-seperated components to it.
return [
"tests",
f"{cmd}",
f"--cross-prefix={state.cross_prefix}",
f"--{opt_flag}",
f"--{auto_flag}",
f"--no-compile",
f"--run",
*(["--verbose"] if state.verbose else []),
]

def _cmds(compile_flag: str, run_flag: str) -> TypedDict:
return {
Expand Down

0 comments on commit 9b06cdc

Please sign in to comment.