summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-08-21 11:08:09 +0200
committerLoïc Hoguin <[email protected]>2015-08-21 11:08:09 +0200
commit33121afc5f76547c3ebb74737b152d20ac9459bd (patch)
treed86e877c1a5d51d5e7f07b319b554fa99165773d
parent8a8aacd696a7454c8134d8c3bd01885f3b9dc125 (diff)
downloadct_helper-33121afc5f76547c3ebb74737b152d20ac9459bd.tar.gz
ct_helper-33121afc5f76547c3ebb74737b152d20ac9459bd.tar.bz2
ct_helper-33121afc5f76547c3ebb74737b152d20ac9459bd.zip
Add function to retrieve name of calling function
-rw-r--r--src/ct_helper.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ct_helper.erl b/src/ct_helper.erl
index 7516e9b..33dfccd 100644
--- a/src/ct_helper.erl
+++ b/src/ct_helper.erl
@@ -24,6 +24,7 @@
-export([ignore/3]).
-export([make_certs/0]).
-export([make_certs_in_ets/0]).
+-export([name/0]).
-export([start/1]).
-type der_encoded() :: binary().
@@ -122,6 +123,11 @@ make_certs_in_ets() ->
ets:insert(?MODULE, {cert_opts, CertOpts}),
ok.
+%% @doc Return the name of the calling function.
+
+name() ->
+ element(2, hd(tl(element(2, process_info(self(), current_stacktrace))))).
+
%% @doc Start and stop applications and their dependencies.
start(Apps) ->