s/sfc/gsc/g
'
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
% dynamic hacky module that loads all the tests
|
||||
-module(sfc_tests).
|
||||
|
||||
-export([
|
||||
main/0,
|
||||
cli_args/1
|
||||
]).
|
||||
|
||||
|
||||
|
||||
main() ->
|
||||
cli_args([]),
|
||||
ok.
|
||||
|
||||
cli_args(TestNames) ->
|
||||
% load ts_utils
|
||||
TsUtils = zx:get_home() ++ "/test/ts_utils.erl",
|
||||
case compile:file(TsUtils) of
|
||||
{ok, ts_utils} -> ok;
|
||||
Error -> error(Error)
|
||||
end,
|
||||
% this loads the test deps and then cleans up any
|
||||
% beam files afterwards
|
||||
ts_utils:tidily(fun() -> do_sfc_test(TestNames) end).
|
||||
|
||||
|
||||
%do_sfc_test(["-h" | _]) -> do_help();
|
||||
%do_sfc_test(["--help" | _]) -> do_help();
|
||||
do_sfc_test(["-l" | _]) -> do_list();
|
||||
do_sfc_test(["--list" | _]) -> do_list();
|
||||
do_sfc_test(["-a" | _]) -> do_all();
|
||||
do_sfc_test(["--all" | _]) -> do_all();
|
||||
do_sfc_test(["so_tokens", X]) -> do_so_tokens(X);
|
||||
do_sfc_test(["so", "tokens", X]) -> do_so_tokens(X);
|
||||
do_sfc_test(["tokenizers_agree", X]) ->
|
||||
do_tokenizers_agree(X);
|
||||
do_sfc_test([TestName]) ->
|
||||
case ts_utils:test_exists_by_name(TestName) of
|
||||
true -> ts_utils:run_test_by_name(TestName);
|
||||
false -> sfc_cli:do_help()
|
||||
end;
|
||||
do_sfc_test(_) ->
|
||||
sfc_cli:do_help().
|
||||
|
||||
|
||||
|
||||
%do_help() ->
|
||||
% io:format("go help yourself~n").
|
||||
|
||||
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]).
|
||||
Reference in New Issue
Block a user