From 3237b512933560ea43173847c44d8d8dab93fd3a Mon Sep 17 00:00:00 2001 From: Andrey Pampukha Date: Thu, 4 Mar 2010 14:38:41 +0100 Subject: Allow callbacks to take any list as parameter --- lib/common_test/src/ct_config_xml.erl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/common_test/src/ct_config_xml.erl') 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, _}= -- cgit v1.2.3