aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorAndrey Pampukha <[email protected]>2010-03-22 16:23:42 +0100
committerRaimo Niskanen <[email protected]>2010-06-09 16:19:15 +0200
commitafff4fa809f4e5dbb5a8dca556f30df825d9c781 (patch)
treee50a3ed11e89b79060a3b12bb5615ba1d5258e17 /lib/common_test
parent2fa838d02446ad54588c2fe6995e3c065e99ec9c (diff)
downloadotp-afff4fa809f4e5dbb5a8dca556f30df825d9c781.tar.gz
otp-afff4fa809f4e5dbb5a8dca556f30df825d9c781.tar.bz2
otp-afff4fa809f4e5dbb5a8dca556f30df825d9c781.zip
Bug fix: ["config.txt"] /= "config.txt"
Diffstat (limited to 'lib/common_test')
-rwxr-xr-xlib/common_test/src/ct_config.erl43
-rw-r--r--lib/common_test/src/ct_testspec.erl2
2 files changed, 28 insertions, 17 deletions
diff --git a/lib/common_test/src/ct_config.erl b/lib/common_test/src/ct_config.erl
index 6fd89c5617..312dc8782f 100755
--- a/lib/common_test/src/ct_config.erl
+++ b/lib/common_test/src/ct_config.erl
@@ -208,7 +208,9 @@ get_config_file_list(Opts)->
read_config_files(Opts) ->
AddCallback = fun(CallBack, [])->
[{CallBack, []}];
- (CallBack, Files)->
+ (CallBack, [F|_]=Files) when is_integer(F)->
+ [{CallBack, Files}];
+ (CallBack, [F|_]=Files) when is_list(F)->
lists:map(fun(X)-> {CallBack, X} end, Files)
end,
ConfigFiles = case lists:keyfind(config, 1, Opts) of
@@ -697,20 +699,31 @@ check_callback_load(Callback)->
end.
check_config_files(Configs)->
- lists:keysearch(error, 1,
- lists:flatten(
- lists:map(fun({Callback, Files})->
- case check_callback_load(Callback) of
- {ok, Callback}->
- lists:map(fun(File)->
- Callback:check_parameter(File)
- end,
- Files);
- {error, _}->
- {error, {callback, Callback}}
- end
- end,
- Configs))).
+ ConfigChecker = fun
+ ({Callback, [F|_R]=Files})->
+ case check_callback_load(Callback) of
+ {ok, Callback}->
+ if
+ is_integer(F)->
+ Callback:check_parameter(Files);
+ is_list(F)->
+ lists:map(fun(File)->
+ Callback:check_parameter(File)
+ end,
+ Files)
+ end;
+ {error, _}->
+ {error, {callback, Callback}}
+ end;
+ ({Callback, []})->
+ case check_callback_load(Callback) of
+ {ok, Callback}->
+ Callback:check_parameter([]);
+ {error, _}->
+ {error, {callback, Callback}}
+ end
+ end,
+ lists:keysearch(error, 1, lists:flatten(lists:map(ConfigChecker, Configs))).
prepare_user_configs([ConfigString|UserConfigs], Acc, new)->
prepare_user_configs(UserConfigs,
diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl
index c07de370b0..028c614991 100644
--- a/lib/common_test/src/ct_testspec.erl
+++ b/lib/common_test/src/ct_testspec.erl
@@ -306,8 +306,6 @@ get_global([{node,Ref,Node}|Ts],Spec=#testspec{nodes=Refs}) ->
get_global([_|Ts],Spec) -> get_global(Ts,Spec);
get_global([],Spec) -> Spec.
-% TODO probably we can terminate here, if any problem with the filename
-% anyway, later ct_run will do it for us :-)
get_absfile(Callback, FullName,#testspec{spec_dir=SpecDir}) ->
% we need to temporary switch to new cwd here, because
% otherwise config files cannot be found