Last sync 2016.04.01
[deliverable/titan.core.git] / regression_test / ttcn2json / Testcases.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2016 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 * Contributors:
9 * Balasko, Jeno
10 * Baranyi, Botond
11 *
12 ******************************************************************************/
13
14 module Testcases {
15
16 import from Shell all;
17 import from CompareSchemas all;
18
19 function f_test_ttcn2json(in charstring p_args, in charstring p_gen_file_name, in charstring p_exp_file_name,
20 in integer p_exp_result) runs on Shell_CT
21 {
22 var charstring v_cmd := "compiler --ttcn2json " & p_args;
23 f_shellCommandWithVerdict(v_cmd, "", p_exp_result);
24
25 if (getverdict == pass) {
26 if (f_compare_schemas(p_gen_file_name, p_exp_file_name) == false) {
27 setverdict(fail, "Generated and expected files do not match");
28 }
29 }
30 else {
31 action("Command ", v_cmd, " failed");
32 }
33
34 }
35
36 testcase tc_t2j_one() runs on Shell_CT
37 {
38 f_test_ttcn2json("-f one.ttcn two.ttcn three.ttcn zero.asn", "one.json", "one_e.json",
39 c_shell_successWithWarning);
40 }
41
42 testcase tc_t2j_two() runs on Shell_CT
43 {
44 f_test_ttcn2json("-jf one.ttcn two.ttcn three.ttcn zero.asn - two.json", "two.json", "two_e.json",
45 c_shell_successWithWarning);
46 }
47
48 testcase tc_t2j_three() runs on Shell_CT
49 {
50 f_test_ttcn2json("-j -T one.ttcn -T two.ttcn -T three.ttcn -A zero.asn - three.json", "three.json", "three_e.json",
51 c_shell_successWithWarning);
52 }
53
54 testcase tc_t2j_general_types() runs on Shell_CT
55 {
56 f_test_ttcn2json("General_Types.ttcn", "General_Types.json", "General_Types_e.json",
57 c_shell_successWithoutWarningAndError);
58 }
59
60 testcase tc_t2j_main_asn() runs on Shell_CT
61 {
62 f_test_ttcn2json("-f Main.ttcn PDU_Definitions.asn", "Main.json", "Main_e.json",
63 c_shell_successWithoutWarningAndError);
64 }
65
66 testcase tc_t2j_mini_ranap() runs on Shell_CT
67 {
68 f_test_ttcn2json("MiniRanap.asn", "MiniRanap.json", "MiniRanap_e.json",
69 c_shell_successWithoutWarningAndError);
70 }
71
72 testcase tc_t2j_subtype() runs on Shell_CT
73 {
74 f_test_ttcn2json("SubType.ttcn", "SubType.json", "SubType_e.json",
75 c_shell_successWithoutWarningAndError);
76 }
77
78 control {
79 execute(tc_t2j_one());
80 execute(tc_t2j_two());
81 execute(tc_t2j_three());
82 execute(tc_t2j_general_types());
83 execute(tc_t2j_main_asn());
84 execute(tc_t2j_mini_ranap());
85 execute(tc_t2j_subtype());
86 }
87
88 }
89
This page took 0.034411 seconds and 5 git commands to generate.