Sync with 5.2.0
[deliverable/titan.core.git] / regression_test / ttcn2json / Testcases.ttcn
CommitLineData
970ed795
EL
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
9module Testcases {
10
11import from Shell all;
af710487 12import from CompareSchemas all;
970ed795
EL
13
14function 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
970ed795 20 if (getverdict == pass) {
af710487 21 if (f_compare_schemas(p_gen_file_name, p_exp_file_name) == false) {
22 setverdict(fail, "Generated and expected files do not match");
970ed795
EL
23 }
24 }
25 else {
26 action("Command ", v_cmd, " failed");
af710487 27 }
28
970ed795
EL
29}
30
31testcase tc_t2j_one() runs on Shell_CT
32{
af710487 33 f_test_ttcn2json("-f one.ttcn two.ttcn three.ttcn zero.asn", "one.json", "one_e.json",
970ed795
EL
34 c_shell_successWithWarning);
35}
36
37testcase tc_t2j_two() runs on Shell_CT
38{
af710487 39 f_test_ttcn2json("-jf one.ttcn two.ttcn three.ttcn zero.asn - two.json", "two.json", "two_e.json",
970ed795
EL
40 c_shell_successWithWarning);
41}
42
43testcase tc_t2j_three() runs on Shell_CT
44{
af710487 45 f_test_ttcn2json("-j -T one.ttcn -T two.ttcn -T three.ttcn -A zero.asn - three.json", "three.json", "three_e.json",
970ed795
EL
46 c_shell_successWithWarning);
47}
48
49testcase 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
af710487 55testcase 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
61testcase 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
970ed795
EL
67control {
68 execute(tc_t2j_one());
69 execute(tc_t2j_two());
70 execute(tc_t2j_three());
71 execute(tc_t2j_general_types());
af710487 72 execute(tc_t2j_main_asn());
73 execute(tc_t2j_mini_ranap());
970ed795
EL
74}
75
76}
77
This page took 0.052597 seconds and 5 git commands to generate.