Sync with 5.2.0
[deliverable/titan.core.git] / regression_test / ttcn2json / Testcases.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2014 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 ******************************************************************************/
8
9 module Testcases {
10
11 import from Shell all;
12 import from CompareSchemas all;
13
14 function f_test_ttcn2json(in charstring p_args, in charstring p_gen_file_name, in charstring p_exp_file_name,
15 in integer p_exp_result) runs on Shell_CT
16 {
17 var charstring v_cmd := "compiler --ttcn2json " & p_args;
18 f_shellCommandWithVerdict(v_cmd, "", p_exp_result);
19
20 if (getverdict == pass) {
21 if (f_compare_schemas(p_gen_file_name, p_exp_file_name) == false) {
22 setverdict(fail, "Generated and expected files do not match");
23 }
24 }
25 else {
26 action("Command ", v_cmd, " failed");
27 }
28
29 }
30
31 testcase tc_t2j_one() runs on Shell_CT
32 {
33 f_test_ttcn2json("-f one.ttcn two.ttcn three.ttcn zero.asn", "one.json", "one_e.json",
34 c_shell_successWithWarning);
35 }
36
37 testcase tc_t2j_two() runs on Shell_CT
38 {
39 f_test_ttcn2json("-jf one.ttcn two.ttcn three.ttcn zero.asn - two.json", "two.json", "two_e.json",
40 c_shell_successWithWarning);
41 }
42
43 testcase tc_t2j_three() runs on Shell_CT
44 {
45 f_test_ttcn2json("-j -T one.ttcn -T two.ttcn -T three.ttcn -A zero.asn - three.json", "three.json", "three_e.json",
46 c_shell_successWithWarning);
47 }
48
49 testcase tc_t2j_general_types() runs on Shell_CT
50 {
51 f_test_ttcn2json("General_Types.ttcn", "General_Types.json", "General_Types_e.json",
52 c_shell_successWithoutWarningAndError);
53 }
54
55 testcase tc_t2j_main_asn() runs on Shell_CT
56 {
57 f_test_ttcn2json("-f Main.ttcn PDU_Definitions.asn", "Main.json", "Main_e.json",
58 c_shell_successWithoutWarningAndError);
59 }
60
61 testcase tc_t2j_mini_ranap() runs on Shell_CT
62 {
63 f_test_ttcn2json("MiniRanap.asn", "MiniRanap.json", "MiniRanap_e.json",
64 c_shell_successWithoutWarningAndError);
65 }
66
67 control {
68 execute(tc_t2j_one());
69 execute(tc_t2j_two());
70 execute(tc_t2j_three());
71 execute(tc_t2j_general_types());
72 execute(tc_t2j_main_asn());
73 execute(tc_t2j_mini_ranap());
74 }
75
76 }
77
This page took 0.06911 seconds and 5 git commands to generate.