aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-03-18 12:34:37 +0100
committerBjörn Gustavsson <[email protected]>2016-03-18 12:34:37 +0100
commite3b85cb860927091d43e3c4d83c9dd9eb2ad51f8 (patch)
tree1828706b34ae646b7eac9d7a1e49073dbc707d3f
parent7e13621fccd53a368b1717495382ae86239ed65b (diff)
downloadotp-e3b85cb860927091d43e3c4d83c9dd9eb2ad51f8.tar.gz
otp-e3b85cb860927091d43e3c4d83c9dd9eb2ad51f8.tar.bz2
otp-e3b85cb860927091d43e3c4d83c9dd9eb2ad51f8.zip
Replace ?config() macro with proplists:get_value()
-rw-r--r--lib/asn1/test/asn1_SUITE.erl18
-rw-r--r--lib/asn1/test/asn1_test_lib.erl8
-rw-r--r--lib/asn1/test/error_SUITE.erl4
-rw-r--r--lib/asn1/test/syntax_SUITE.erl2
-rw-r--r--lib/asn1/test/testContextSwitchingTypes.erl2
-rw-r--r--lib/asn1/test/testMegaco.erl4
-rw-r--r--lib/asn1/test/testNBAPsystem.erl4
-rw-r--r--lib/asn1/test/testParameterizedInfObj.erl4
-rw-r--r--lib/asn1/test/testRfcs.erl4
-rw-r--r--lib/asn1/test/testSSLspecs.erl8
-rw-r--r--lib/asn1/test/test_compile_options.erl20
-rw-r--r--lib/asn1/test/test_modified_x420.erl2
-rw-r--r--lib/asn1/test/test_partial_incomplete_decode.erl2
-rw-r--r--lib/asn1/test/test_undecoded_rest.erl2
14 files changed, 42 insertions, 42 deletions
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl
index 2d7d2185c5..b08ab518df 100644
--- a/lib/asn1/test/asn1_SUITE.erl
+++ b/lib/asn1/test/asn1_SUITE.erl
@@ -196,13 +196,13 @@ end_per_group(_GroupName, Config) ->
Config.
init_per_testcase(Func, Config) ->
- CaseDir = filename:join(?config(priv_dir, Config), Func),
+ CaseDir = filename:join(proplists:get_value(priv_dir, Config), Func),
ok = filelib:ensure_dir(filename:join([CaseDir, dummy_file])),
true = code:add_patha(CaseDir),
[{case_dir, CaseDir}|Config].
end_per_testcase(_Func, Config) ->
- code:del_path(?config(case_dir, Config)).
+ code:del_path(proplists:get_value(case_dir, Config)).
%%------------------------------------------------------------------------------
%% Test runners
@@ -240,7 +240,7 @@ opts(Rule) when is_atom(Rule) -> [];
opts({_Rule, Opts}) -> Opts.
run_case(Config, Fun, Rule, Opts) ->
- CaseDir = ?config(case_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
Dir = filename:join([CaseDir, join(Rule, Opts)]),
ok = filelib:ensure_dir(filename:join([Dir, dummy_file])),
replace_path(CaseDir, Dir),
@@ -462,7 +462,7 @@ testSeqExtension(Config, Rule, Opts) ->
"SeqExtension2"],
Config,
[Rule|Opts]),
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
testSeqExtension:main(Rule, DataDir, [Rule|Opts]).
testSeqOptional(Config) -> test(Config, fun testSeqOptional/3).
@@ -582,8 +582,8 @@ constraint_equivalence(Config, Rule, Opts) ->
asn1_test_lib:compile(M, Config, [Rule|Opts]).
constraint_equivalence_abs(Config) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
Asn1Spec = "ConstraintEquivalence",
Asn1Src = filename:join(DataDir, Asn1Spec),
ok = asn1ct:compile(Asn1Src, [abs,{outdir,CaseDir}]),
@@ -634,7 +634,7 @@ module_test(M0, Config, Rule, Opts) ->
%% value for 'Filter' is not guaranteed to terminate.
ok;
M ->
- TestOpts = [{i, ?config(case_dir, Config)}],
+ TestOpts = [{i, proplists:get_value(case_dir, Config)}],
case asn1ct:test(M, TestOpts) of
ok ->
ok;
@@ -765,7 +765,7 @@ testInfObjectClass(Config, Rule, Opts) ->
testUniqueObjectSets(Config) -> test(Config, fun testUniqueObjectSets/3).
testUniqueObjectSets(Config, Rule, Opts) ->
- CaseDir = ?config(case_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
testUniqueObjectSets:main(CaseDir, Rule, Opts).
testInfObjExtract(Config) -> test(Config, fun testInfObjExtract/3).
@@ -1136,7 +1136,7 @@ test_modules() ->
"CCSNARG3"].
test_OTP_9688(Config) ->
- PrivDir = ?config(case_dir, Config),
+ PrivDir = proplists:get_value(case_dir, Config),
Data = "
OTP-9688 DEFINITIONS ::= BEGIN
diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl
index dbb2600b41..21f00b0968 100644
--- a/lib/asn1/test/asn1_test_lib.erl
+++ b/lib/asn1/test/asn1_test_lib.erl
@@ -34,8 +34,8 @@ run_dialyzer() ->
compile(File, Config, Options) -> compile_all([File], Config, Options).
compile_all(Files, Config, Options) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
[compile_file(filename:join(DataDir, F), [{outdir, CaseDir},
debug_info|Options])
|| F <- Files],
@@ -99,8 +99,8 @@ compile_file(File, Options) ->
end.
compile_erlang(Mod, Config, Options) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
M = list_to_atom(Mod),
{ok, M} = compile:file(filename:join(DataDir, Mod),
[report,{i,CaseDir},{outdir,CaseDir}|Options]).
diff --git a/lib/asn1/test/error_SUITE.erl b/lib/asn1/test/error_SUITE.erl
index caae845592..a8c6b894f1 100644
--- a/lib/asn1/test/error_SUITE.erl
+++ b/lib/asn1/test/error_SUITE.erl
@@ -929,8 +929,8 @@ values(Config) ->
run({Mod,Spec}, Config) ->
Base = atom_to_list(Mod) ++ ".asn1",
- File = filename:join(?config(priv_dir, Config), Base),
- Include0 = filename:dirname(?config(data_dir, Config)),
+ File = filename:join(proplists:get_value(priv_dir, Config), Base),
+ Include0 = filename:dirname(proplists:get_value(data_dir, Config)),
Include = filename:join(filename:dirname(Include0), "asn1_SUITE_data"),
ok = file:write_file(File, Spec),
asn1ct:compile(File, [{i, Include}]).
diff --git a/lib/asn1/test/syntax_SUITE.erl b/lib/asn1/test/syntax_SUITE.erl
index a354b75062..56b8f32ff7 100644
--- a/lib/asn1/test/syntax_SUITE.erl
+++ b/lib/asn1/test/syntax_SUITE.erl
@@ -305,7 +305,7 @@ run(List, File, Config) ->
run(List, File0, Config, Module) ->
Base = File0 ++ ".asn1",
- File = filename:join(?config(priv_dir, Config), Base),
+ File = filename:join(proplists:get_value(priv_dir, Config), Base),
case run_1(List, Base, File, Module, 0) of
0 -> ok;
Errors -> ?t:fail(Errors)
diff --git a/lib/asn1/test/testContextSwitchingTypes.erl b/lib/asn1/test/testContextSwitchingTypes.erl
index 3779f61f2f..62fe4c2168 100644
--- a/lib/asn1/test/testContextSwitchingTypes.erl
+++ b/lib/asn1/test/testContextSwitchingTypes.erl
@@ -38,7 +38,7 @@ test(Config) ->
check_EXTERNAL(enc_dec('T', ValT_4)),
{ok,ValT2} = asn1ct:value('ContextSwitchingTypes', 'T',
- [{i,?config(case_dir, Config)}]),
+ [{i,proplists:get_value(case_dir, Config)}]),
io:format("ValT2 ~p~n",[ValT2]),
check_EXTERNAL(enc_dec('T', ValT2)),
diff --git a/lib/asn1/test/testMegaco.erl b/lib/asn1/test/testMegaco.erl
index 61794ec02d..e298622a0f 100644
--- a/lib/asn1/test/testMegaco.erl
+++ b/lib/asn1/test/testMegaco.erl
@@ -32,13 +32,13 @@ compile(Config, Erule, Options) ->
main(no_module,_) -> ok;
main('OLD-MEDIA-GATEWAY-CONTROL',Config) ->
- CaseDir = ?config(case_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
{ok,Msg} = asn1ct:value('OLD-MEDIA-GATEWAY-CONTROL','MegacoMessage',
[{i, CaseDir}]),
asn1_test_lib:roundtrip('OLD-MEDIA-GATEWAY-CONTROL', 'MegacoMessage', Msg),
ok;
main('MEDIA-GATEWAY-CONTROL'=Mod, Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Files = filelib:wildcard(filename:join([DataDir,megacomessages,"*.val"])),
lists:foreach(fun(File) ->
{ok,Bin} = file:read_file(File),
diff --git a/lib/asn1/test/testNBAPsystem.erl b/lib/asn1/test/testNBAPsystem.erl
index 5e1c16a1a0..956da1e632 100644
--- a/lib/asn1/test/testNBAPsystem.erl
+++ b/lib/asn1/test/testNBAPsystem.erl
@@ -285,8 +285,8 @@ compare(_,_) ->
false.
check_record_names(Msg,Config) ->
- DataDir = ?config(data_dir,Config),
- CaseDir = ?config(case_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ CaseDir = proplists:get_value(case_dir,Config),
{ok, test_records} = compile:file(filename:join([DataDir, "test_records"]),
[{i, CaseDir}]),
ok = test_records:'check_record_names_OTP-5812'(Msg).
diff --git a/lib/asn1/test/testParameterizedInfObj.erl b/lib/asn1/test/testParameterizedInfObj.erl
index 63fa2fcf09..d7bcde963b 100644
--- a/lib/asn1/test/testParameterizedInfObj.erl
+++ b/lib/asn1/test/testParameterizedInfObj.erl
@@ -121,8 +121,8 @@ param2(Config, Erule) ->
{'ProtocolIE-Field',101,true}]}),
%% Now remove the data after the extension mark in the object set.
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
Asn1SrcBase = "Param2.asn1",
Asn1SrcFile0 = filename:join(DataDir, Asn1SrcBase),
{ok,Src0} = file:read_file(Asn1SrcFile0),
diff --git a/lib/asn1/test/testRfcs.erl b/lib/asn1/test/testRfcs.erl
index fa4389b904..e110f87edd 100644
--- a/lib/asn1/test/testRfcs.erl
+++ b/lib/asn1/test/testRfcs.erl
@@ -27,11 +27,11 @@
compile(Config, Erules, Options0) ->
Options = [no_ok_wrapper|Options0],
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Specs0 = filelib:wildcard("*.asn1", filename:join(DataDir, rfcs)),
Specs = [filename:join(rfcs, Spec) || Spec <- Specs0],
122 = length(Specs),
- CaseDir = ?config(case_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
asn1_test_lib:compile_all(Specs, Config, [Erules,{i,CaseDir}|Options]).
test() ->
diff --git a/lib/asn1/test/testSSLspecs.erl b/lib/asn1/test/testSSLspecs.erl
index 035912d767..5d5f749d37 100644
--- a/lib/asn1/test/testSSLspecs.erl
+++ b/lib/asn1/test/testSSLspecs.erl
@@ -26,8 +26,8 @@
-include_lib("common_test/include/ct.hrl").
compile(Config, Options) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
NewOptions = [{i, DataDir}, {i, CaseDir}|Options],
asn1_test_lib:compile_all(["SSL-PKIX", "PKIXAttributeCertificate"],
@@ -44,8 +44,8 @@ compile(Config, Options) ->
Config, NewOptions).
compile_combined(Config, ber=Rule) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
Options = [{i, CaseDir}, {i, DataDir}, Rule,
der, compact_bit_string, asn1config],
ok = remove_db_files_combined(CaseDir),
diff --git a/lib/asn1/test/test_compile_options.erl b/lib/asn1/test/test_compile_options.erl
index e9806a7670..ea67514229 100644
--- a/lib/asn1/test/test_compile_options.erl
+++ b/lib/asn1/test/test_compile_options.erl
@@ -39,16 +39,16 @@ wrong_path(Config) ->
end.
comp(Parent,Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
Err=asn1ct:compile(DataDir++"NoImport",[{i,OutDir},{i,filename:join([DataDir,"subdir"])},{outdir,OutDir}]),
Parent!Err.
%% OTP-5701
path(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
{ok,CWD} = file:get_cwd(),
file:set_cwd(filename:join([DataDir,subdir])),
@@ -67,8 +67,8 @@ path(Config) ->
ticket_6143(Config) -> asn1_test_lib:compile("AA1", Config, []).
noobj(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
code:purge('P-Record'),
file:delete(filename:join([OutDir,'P-Record.erl'])),
@@ -112,8 +112,8 @@ noobj(Config) ->
file:delete(filename:join([OutDir,'p_record.beam'])).
verbose(Config) when is_list(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
Asn1File = filename:join([DataDir,"Comment.asn"]),
%% Test verbose compile
@@ -152,8 +152,8 @@ outfiles_remove(OutDir) ->
outfiles1()).
record_name_prefix(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
ok = b_SeqIn(DataDir,OutDir),
ok = a_SeqIn(DataDir,OutDir).
diff --git a/lib/asn1/test/test_modified_x420.erl b/lib/asn1/test/test_modified_x420.erl
index c0a32e2a37..a83d522764 100644
--- a/lib/asn1/test/test_modified_x420.erl
+++ b/lib/asn1/test/test_modified_x420.erl
@@ -24,7 +24,7 @@
-include_lib("common_test/include/ct.hrl").
test(Config) ->
- DataDir = ?config(data_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
Der = read_pem(filename:join([DataDir,modified_x420,"p7_signed_data.pem"])),
{ok,{_,_,SignedData}} = 'PKCS7':decode( 'ContentInfo', Der),
diff --git a/lib/asn1/test/test_partial_incomplete_decode.erl b/lib/asn1/test/test_partial_incomplete_decode.erl
index d809e7c57c..2b1c3bd8c5 100644
--- a/lib/asn1/test/test_partial_incomplete_decode.erl
+++ b/lib/asn1/test/test_partial_incomplete_decode.erl
@@ -67,7 +67,7 @@ test(Config) ->
ok.
test_megaco(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Files = filelib:wildcard(filename:join([DataDir,megacomessages,"*.val"])),
Mod = 'MEDIA-GATEWAY-CONTROL',
lists:foreach(fun(File) ->
diff --git a/lib/asn1/test/test_undecoded_rest.erl b/lib/asn1/test/test_undecoded_rest.erl
index 77147d59cc..9711fd3e8c 100644
--- a/lib/asn1/test/test_undecoded_rest.erl
+++ b/lib/asn1/test/test_undecoded_rest.erl
@@ -29,7 +29,7 @@
test(Opts, Config) ->
{ok,Msg} = asn1ct:value('P-Record', 'PersonnelRecord',
- [{i,?config(case_dir, Config)}]),
+ [{i,proplists:get_value(case_dir, Config)}]),
Bytes0 = encode(Opts, 'PersonnelRecord', Msg),
Bytes1 = iolist_to_binary([Bytes0, <<55,55,55>>]),
case proplists:get_bool(undec_rest, Opts) of