From a33e5395ae1bc968c8fa007963b36327de582a99 Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Sun, 14 Jun 2026 10:22:47 +0200 Subject: cli: scope GPU options to their respective build targets --- tests/test_cli.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'tests') diff --git a/tests/test_cli.c b/tests/test_cli.c index c5151e9..76a3f14 100644 --- a/tests/test_cli.c +++ b/tests/test_cli.c @@ -157,26 +157,13 @@ int main(int argc, char **argv) "--stream -b 2 exits 0"); expect(count_lines(g_out) == 3, "--stream -b 2 covers the tail batch"); - /* Flag validation: every bad invocation must exit 1. - * This is a CPU-only build, so the GPU flags are rejected too. */ + /* Flag validation: missing model dir must exit 1. */ static const struct { const char *args; const char *what; } bad[] = { - {"--backend foo", "invalid --backend"}, - {"--backend mlx", "--backend mlx without MLX build"}, - {"--backend cuda", "--backend cuda without CUDA build"}, - {"--mlx", "--mlx without MLX build"}, - {"--cuda", "--cuda without CUDA build"}, - {"--mlx-quant-bits 4", "--mlx-quant-bits 4"}, - {"--mlx-quant-group-size 0", "--mlx-quant-group-size 0"}, - {"--cuda-gemm-mode f32 -d X t", "--cuda-gemm-mode without CUDA"}, - {"--cuda-weight-dtype bf16 -d X t", "--cuda-weight-dtype without CUDA"}, + {"-d '' t", "empty model dir"}, }; for (size_t i = 0; i < sizeof(bad) / sizeof(bad[0]); i++) expect(run_cli(bad[i].args, NULL) == 1, bad[i].what); - /* Validation that runs after the model dir is accepted. */ - snprintf(args, sizeof(args), "-d '%s' --mlx-quant-bits 8 t", g_dir); - expect(run_cli(args, NULL) == 1, "--mlx-quant-bits without --mlx"); - if (g_failures) { fprintf(stderr, "%d CLI check(s) failed\n", g_failures); return 1; -- cgit v1.3.1