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_xml.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_xml.erl')
-rwxr-xr-x | lib/common_test/src/ct_config_xml.erl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/common_test/src/ct_config_xml.erl b/lib/common_test/src/ct_config_xml.erl index 79f25cead7..4b16c7c675 100755 --- a/lib/common_test/src/ct_config_xml.erl +++ b/lib/common_test/src/ct_config_xml.erl @@ -22,10 +22,10 @@ %% Created : 16 February 2010 %%---------------------------------------------------------------------- -module(ct_config_xml). --export([read_config_file/1]). +-export([read_config/1, check_parameter/1]). -% the only function to be called outside -read_config_file(ConfigFile) -> +% read config file +read_config(ConfigFile) -> case catch do_read_xml_config(ConfigFile) of {ok, Config}-> {ok, Config}; @@ -33,6 +33,15 @@ read_config_file(ConfigFile) -> {error, Error, ErroneousString} end. +% check against existence of the file +check_parameter(File)-> + case filelib:is_file(File) of + true-> + {ok, {file, File}}; + false-> + {nok, {nofile, File}} + end. + % actual reading of the config do_read_xml_config(ConfigFile)-> {ok, EntityList, _}= |