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 ******************************************************************************/
11 import from Shell all;
12 import from CompareSchemas all;
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
17 var charstring v_cmd := "compiler --ttcn2json " & p_args;
18 f_shellCommandWithVerdict(v_cmd, "", p_exp_result);
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");
26 action("Command ", v_cmd, " failed");
31 testcase tc_t2j_one() runs on Shell_CT
33 f_test_ttcn2json("-f one.ttcn two.ttcn three.ttcn zero.asn", "one.json", "one_e.json",
34 c_shell_successWithWarning);
37 testcase tc_t2j_two() runs on Shell_CT
39 f_test_ttcn2json("-jf one.ttcn two.ttcn three.ttcn zero.asn - two.json", "two.json", "two_e.json",
40 c_shell_successWithWarning);
43 testcase tc_t2j_three() runs on Shell_CT
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);
49 testcase tc_t2j_general_types() runs on Shell_CT
51 f_test_ttcn2json("General_Types.ttcn", "General_Types.json", "General_Types_e.json",
52 c_shell_successWithoutWarningAndError);
55 testcase tc_t2j_main_asn() runs on Shell_CT
57 f_test_ttcn2json("-f Main.ttcn PDU_Definitions.asn", "Main.json", "Main_e.json",
58 c_shell_successWithoutWarningAndError);
61 testcase tc_t2j_mini_ranap() runs on Shell_CT
63 f_test_ttcn2json("MiniRanap.asn", "MiniRanap.json", "MiniRanap_e.json",
64 c_shell_successWithoutWarningAndError);
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());