diff options
author | Andrey Pampukha <[email protected]> | 2010-03-04 14:38:41 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2010-06-09 16:19:09 +0200 |
commit | 3237b512933560ea43173847c44d8d8dab93fd3a (patch) | |
tree | ef8974e31e29ad0e4dcdcdf2a5665128c6ccb3f9 /lib/common_test/src/ct_config_plain.erl | |
parent | c5275f3dc1d78ecbe1bf311b7c04c3c815a293d9 (diff) | |
download | otp-3237b512933560ea43173847c44d8d8dab93fd3a.tar.gz otp-3237b512933560ea43173847c44d8d8dab93fd3a.tar.bz2 otp-3237b512933560ea43173847c44d8d8dab93fd3a.zip |
Allow callbacks to take any list as parameter
Diffstat (limited to 'lib/common_test/src/ct_config_plain.erl')
-rwxr-xr-x | lib/common_test/src/ct_config_plain.erl | 13 |
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',_} -> |