aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_config_plain.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common_test/src/ct_config_plain.erl')
-rwxr-xr-xlib/common_test/src/ct_config_plain.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_config_plain.erl b/lib/common_test/src/ct_config_plain.erl
index be0433aa9f..327fc66b40 100755
--- a/lib/common_test/src/ct_config_plain.erl
+++ b/lib/common_test/src/ct_config_plain.erl
@@ -22,9 +22,9 @@
%% Created : 15 February 2010
%%----------------------------------------------------------------------
-module(ct_config_plain).
--export([read_config_file/1]).
+-export([read_config/1, check_parameter/1]).
-read_config_file(ConfigFile) ->
+read_config(ConfigFile) ->
case file:consult(ConfigFile) of
{ok,Config} ->
{ok, Config};
@@ -65,6 +65,15 @@ read_config_file(ConfigFile) ->
end
end.
+% check against existence of config file
+check_parameter(File)->
+ case filelib:is_file(File) of
+ true->
+ {ok, {file, File}};
+ false->
+ {nok, {nofile, File}}
+ end.
+
read_config_terms(Bin) when is_binary(Bin) ->
case catch binary_to_list(Bin) of
{'EXIT',_} ->