diff options
author | Peter Andersson <[email protected]> | 2017-10-03 14:53:42 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2017-10-25 17:28:55 +0200 |
commit | 70b6b32a9c7e3e3fca45fc3a0e11e2a5087a4660 (patch) | |
tree | ffce83db6a82e5aaa89f474732794c9a915d6157 /lib/common_test/src/ct_run.erl | |
parent | 7fb796ab3636af53a7ef659099c1fb9fe37c1957 (diff) | |
download | otp-70b6b32a9c7e3e3fca45fc3a0e11e2a5087a4660.tar.gz otp-70b6b32a9c7e3e3fca45fc3a0e11e2a5087a4660.tar.bz2 otp-70b6b32a9c7e3e3fca45fc3a0e11e2a5087a4660.zip |
Add app name tag in process dictionary
Diffstat (limited to 'lib/common_test/src/ct_run.erl')
-rw-r--r-- | lib/common_test/src/ct_run.erl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 14f28f9ca3..7079e059f4 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -250,6 +250,8 @@ finish(Tracing, ExitStatus, Args) -> end. script_start1(Parent, Args) -> + %% tag this process + put(app, common_test), %% read general start flags Label = get_start_opt(label, fun([Lbl]) -> Lbl end, Args), Profile = get_start_opt(profile, fun([Prof]) -> Prof end, Args), @@ -956,7 +958,10 @@ run_test(StartOpts) when is_list(StartOpts) -> -spec run_test1_fun(_) -> fun(() -> no_return()). run_test1_fun(StartOpts) -> - fun() -> run_test1(StartOpts) end. + fun() -> + put(app, common_test), + run_test1(StartOpts) + end. run_test1(StartOpts) when is_list(StartOpts) -> case proplists:get_value(refresh_logs, StartOpts) of @@ -1447,7 +1452,10 @@ run_testspec(TestSpec) -> -spec run_testspec1_fun(_) -> fun(() -> no_return()). run_testspec1_fun(TestSpec) -> - fun() -> run_testspec1(TestSpec) end. + fun() -> + put(app, common_test), + run_testspec1(TestSpec) + end. run_testspec1(TestSpec) -> {ok,Cwd} = file:get_cwd(), @@ -1906,10 +1914,12 @@ possibly_spawn(true, Tests, Skip, Opts) -> CTUtilSrv = whereis(ct_util_server), Supervisor = fun() -> + put(app, common_test), process_flag(trap_exit, true), link(CTUtilSrv), TestRun = fun() -> + put(app, common_test), TestResult = (catch do_run_test(Tests, Skip, Opts)), case TestResult of {EType,_} = Error when EType == user_error; |