aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE.erl20
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE_data/rfc4004_mip.dia4
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE_data/rfc4005_nas.dia4
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE_data/rfc4006_cc.dia7
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE_data/rfc4072_eap.dia6
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE_data/rfc4590_digest.dia2
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE_data/rfc4740_sip.dia6
7 files changed, 24 insertions, 25 deletions
diff --git a/lib/diameter/test/diameter_compiler_SUITE.erl b/lib/diameter/test/diameter_compiler_SUITE.erl
index 9271cd2ec3..f12fba3654 100644
--- a/lib/diameter/test/diameter_compiler_SUITE.erl
+++ b/lib/diameter/test/diameter_compiler_SUITE.erl
@@ -444,19 +444,31 @@ standards(Config) ->
[D || D <- ?STANDARDS, _ <- [standards(?S(D), Data)]].
standards(Dict, Dir) ->
+ {Name, Pre} = make_name(Dict),
ok = diameter_make:codec(filename:join([Dir, Dict ++ ".dia"]),
- [{name, Dict} | opts(Dict)]),
- {ok, _, _} = compile:file(Dict ++ ".erl", [return]).
+ [{name, Name},
+ {prefix, Pre},
+ inherits("rfc3588_base")
+ | opts(Dict)]),
+ {ok, _, _} = compile:file(Name ++ ".erl", [return]).
opts(M)
when M == "rfc4006_cc";
M == "rfc4072_eap" ->
- [{inherits, "diameter_gen_nas_rfc4005/rfc4005_nas"}];
+ [inherits("rfc4005_nas")];
opts("rfc4740_sip") ->
- [{inherits, "diameter_gen_digest_rfc4590/rfc4590_digest"}];
+ [inherits("rfc4590_digest")];
opts(_) ->
[].
+inherits(File) ->
+ {Name, _} = make_name(File),
+ {inherits, File ++ "/" ++ Name}.
+
+make_name(File) ->
+ {R, [$_|N]} = lists:splitwith(fun(C) -> C /= $_ end, File),
+ {string:join(["diameter_gen", N, R], "_"), "diameter_" ++ N}.
+
%% ===========================================================================
modify(Bin, Mods) ->
diff --git a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4004_mip.dia b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4004_mip.dia
index 7663a8add2..575ad4394a 100644
--- a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4004_mip.dia
+++ b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4004_mip.dia
@@ -29,10 +29,8 @@
;;
@id 2
-@name diameter_gen_mip_rfc4004
-@prefix diameter_mip
-@inherits diameter_gen_base_rfc3588
+@inherits rfc3588_base
;; ===========================================================================
diff --git a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4005_nas.dia b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4005_nas.dia
index 3f5026ced0..a4b44e38bb 100644
--- a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4005_nas.dia
+++ b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4005_nas.dia
@@ -36,10 +36,8 @@
;;
@id 1
-@name diameter_gen_nas_rfc4005
-@prefix diameter_nas
-@inherits diameter_gen_base_rfc3588
+@inherits rfc3588_base
;; ===========================================================================
diff --git a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4006_cc.dia b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4006_cc.dia
index eb4f7f7960..b723e4ddbb 100644
--- a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4006_cc.dia
+++ b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4006_cc.dia
@@ -22,12 +22,9 @@
;;
@id 4
-@name diameter_gen_cc_rfc4006
-@prefix diameter_cc
-@inherits diameter_gen_base_rfc3588
-
-@inherits diameter_gen_nas_rfc4005 Filter-Id
+@inherits rfc3588_base
+@inherits rfc4005_nas Filter-Id
;; ===========================================================================
diff --git a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4072_eap.dia b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4072_eap.dia
index 70eb86e06a..111516b347 100644
--- a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4072_eap.dia
+++ b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4072_eap.dia
@@ -29,11 +29,9 @@
;;
@id 5
-@name diameter_gen_eap_rfc4072
-@prefix diameter_eap
-@inherits diameter_gen_base_rfc3588
-@inherits diameter_gen_nas_rfc4005
+@inherits rfc3588_base
+@inherits rfc4005_nas
;; ===========================================================================
diff --git a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4590_digest.dia b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4590_digest.dia
index 082fd81e67..a4ebe0c456 100644
--- a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4590_digest.dia
+++ b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4590_digest.dia
@@ -21,8 +21,6 @@
;; RFC 4590, RADIUS Extension for Digest Authentication
;;
-@name diameter_gen_digest_rfc4590
-
@avp_types
Digest-Response 103 OctetString -
diff --git a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4740_sip.dia b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4740_sip.dia
index e6f0aa620a..8c21882649 100644
--- a/lib/diameter/test/diameter_compiler_SUITE_data/rfc4740_sip.dia
+++ b/lib/diameter/test/diameter_compiler_SUITE_data/rfc4740_sip.dia
@@ -22,11 +22,9 @@
;;
@id 6
-@name diameter_gen_sip_rfc4740
-@prefix diameter_sip
-@inherits diameter_gen_base_rfc3588
-@inherits diameter_gen_digest_rfc4590
+@inherits rfc3588_base
+@inherits rfc4590_digest
;; ===========================================================================