Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ add_test(NAME dupdef_check COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/ci/dupdef_c
# row keeps the next one from landing.
add_test(NAME tool_help_check COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/ci/tool_help_check.py --check --root tools
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# The same question, asked of the two trees the row above does not cover: `tests/` had 7 helpers that treated the
# flag as a path (4 crashed with FileNotFoundError, 2 as int(), and tests/laya_route_cases.py WROTE a file named
# `--help` into the checkout), plus one onnx runner path. They answer with a usage line and rc 2 now.
add_test(NAME tool_help_check_tests COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/ci/tool_help_check.py --check --root tests
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME tool_help_check_onnx COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/ci/tool_help_check.py --check --root onnx
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME tool_help_check_selftest COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/ci/tool_help_check.py --self-test
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

Expand Down
3 changes: 3 additions & 0 deletions onnx/tests/onnx_conv_integer_types_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def run(runner, model, tensor, dtype, out_dir):


def main(argv):
if len(argv) > 1 and argv[1] in ("-h", "--help"):
print(__doc__.strip().splitlines()[0] if __doc__ else "usage: onnx_conv_integer_types_test.py [runner]")
return 2
runner = argv[1] if len(argv) > 1 else "build/ort_run"
types = {"uint8": TensorProto.UINT8, "int8": TensorProto.INT8}
results = {}
Expand Down
3 changes: 3 additions & 0 deletions tests/batch_check_state_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,9 @@ def tmp_root():


def main():
if len(sys.argv) > 1 and sys.argv[1] in ("-h", "--help"):
print(__doc__.strip().splitlines()[0])
return 2
if len(sys.argv) not in (2, 3) or (len(sys.argv) == 3 and sys.argv[2] not in ("lfm2", "lfm3", "qwen2", "qwen2vl", "qwen2_untied", "qwen3_5", "hy_v3", "hy_v3_sgate")):
print(__doc__.strip().splitlines()[2])
return 2
Expand Down
3 changes: 3 additions & 0 deletions tests/embed_forward_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ def run(binary, d, ids, out):


def main():
if len(sys.argv) == 2 and sys.argv[1] in ("-h", "--help"):
print(__doc__.strip().splitlines()[0])
return 2
if len(sys.argv) != 2:
print(__doc__.strip().splitlines()[2])
return 2
Expand Down
3 changes: 3 additions & 0 deletions tests/fake_lemonade.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
import json, sys
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer

if len(sys.argv) > 1 and sys.argv[1] in ("-h", "--help"):
print("usage: fake_lemonade.py <port> <record-path>")
sys.exit(2)
port, record = int(sys.argv[1]), sys.argv[2]


Expand Down
3 changes: 3 additions & 0 deletions tests/fake_spawn_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import json, os, sys
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer

if len(sys.argv) > 1 and sys.argv[1] in ("-h", "--help"):
print("usage: fake_spawn_exec.py <port>")
sys.exit(2)
port = int(sys.argv[1])
RECORD = os.environ.get("SPAWN_RECORD")

Expand Down
3 changes: 3 additions & 0 deletions tests/gptoss_forward_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ def tmp_root():


def main():
if len(sys.argv) == 2 and sys.argv[1] in ("-h", "--help"):
print(__doc__.strip().splitlines()[0])
return 2
if len(sys.argv) != 2:
print(__doc__.strip().splitlines()[2])
return 2
Expand Down
3 changes: 3 additions & 0 deletions tests/laya_route_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ def main():
instr = LONG_INSTR[i % len(LONG_INSTR)]
cases.append({"class": "long_doc", "text": f"{instr}\n\n{body(k, r)}"})
assert all(sum(c["class"] == k for c in cases) == 50 for k in ("code", "prose", "short", "long_doc"))
if len(sys.argv) > 1 and sys.argv[1] in ("-h", "--help"):
print(__doc__.strip().splitlines()[0])
sys.exit(2)
out = sys.argv[1] if len(sys.argv) > 1 else "tests/laya_route_cases.json"
json.dump({"about": "RFC #186: labelled requests for the Laya request classifier; regenerate with tests/laya_route_cases.py",
"classes": ["code", "prose", "short", "long_doc"], "cases": cases}, open(out, "w"), indent=1, ensure_ascii=False)
Expand Down
3 changes: 3 additions & 0 deletions tests/serve_spec_lookup_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ def start(binary, model, port, extra, log):


def main():
if len(sys.argv) == 2 and sys.argv[1] in ("-h", "--help"):
print(__doc__.strip().splitlines()[0])
return 2
if len(sys.argv) != 2:
print(__doc__.strip().splitlines()[2])
return 2
Expand Down
Loading