some stuff

This commit is contained in:
2026-06-08 16:35:27 -07:00
parent 7c98182bcb
commit 3f73cd4d85
3 changed files with 63 additions and 26 deletions
+30 -9
View File
@@ -19,17 +19,27 @@ cli_args(TestNames) ->
{ok, ts_utils} -> ok;
Error -> error(Error)
end,
ts_utils:tidily(fun() -> do(TestNames) end).
% this loads the test deps and then cleans up any
% beam files afterwards
ts_utils:tidily(fun() -> do_gsc_test(TestNames) end).
do_gsc_test(["-h" | _]) -> do_help();
do_gsc_test(["--help" | _]) -> do_help();
do_gsc_test(["-l" | _]) -> do_list();
do_gsc_test(["--list" | _]) -> do_list();
do_gsc_test(["-a" | _]) -> do_all();
do_gsc_test(["--all" | _]) -> do_all();
do_gsc_test(["so_tokens", X]) -> do_so_tokens(X);
do_gsc_test(["so", "tokens", X]) -> do_so_tokens(X);
do_gsc_test(["tokenizers_agree", X]) ->
do_tokenizers_agree(X);
do_gsc_test([TestName]) ->
ts_utils:run_test_by_name(TestName);
do_gsc_test(_) ->
do_help().
do(["-h" | _]) -> do_help();
do(["--help" | _]) -> do_help();
do(["-l" | _]) -> do_list();
do(["--list" | _]) -> do_list();
do(["-a" | _]) -> do_all();
do(["--all" | _]) -> do_all();
do(TestNames) ->
lists:foreach(fun ts_utils:run_test_by_name/1, TestNames).
do_help() ->
io:format("go help yourself~n").
@@ -38,6 +48,17 @@ do_list() ->
Names = ts_utils:runnable_test_names(),
[io:format("~p~n", [N]) || N <- Names].
do_all() ->
{Gd, _} = ts_utils:runnable_test_mods(),
[begin ts_utils:rmm(G), io:format("~n") end || G <- Gd].
do_so_tokens(FilePath) ->
[io:format("~p~n", [Tk]) || Tk <- ts_utils:so_tokens(FilePath)].
do_tokenizers_agree(RelPath) ->
Result = ts_utils:tokenizers_agree(RelPath),
io:format("~tp~n", [Result]).