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;
13 function f_test_ttcn2json(in charstring p_args, in charstring p_gen_file_name, in charstring p_exp_file_name,
14 in integer p_exp_result) runs on Shell_CT
16 var charstring v_cmd := "compiler --ttcn2json " & p_args;
17 f_shellCommandWithVerdict(v_cmd, "", p_exp_result);
19 /* The generated schema cannot be checked this way, as different platforms generate the parts of the schema
21 if (getverdict == pass) {
22 f_compareFiles(p_gen_file_name, p_exp_file_name, 0);
23 if (getverdict == fail) {
24 action("Generated and expected files do not match");
28 action("Command ", v_cmd, " failed");
32 testcase tc_t2j_one() runs on Shell_CT
34 f_test_ttcn2json("one.ttcn two.ttcn three.ttcn zero.asn", "one.json", "one_e.json",
35 c_shell_successWithWarning);
38 testcase tc_t2j_two() runs on Shell_CT
40 f_test_ttcn2json("one.ttcn two.ttcn three.ttcn zero.asn - two.json", "two.json", "one_e.json",
41 c_shell_successWithWarning);
44 testcase tc_t2j_three() runs on Shell_CT
46 f_test_ttcn2json("-T one.ttcn -T two.ttcn -T three.ttcn -A zero.asn - three.json", "three.json", "one_e.json",
47 c_shell_successWithWarning);
50 testcase tc_t2j_general_types() runs on Shell_CT
52 f_test_ttcn2json("General_Types.ttcn", "General_Types.json", "General_Types_e.json",
53 c_shell_successWithoutWarningAndError);
57 execute(tc_t2j_one());
58 execute(tc_t2j_two());
59 execute(tc_t2j_three());
60 execute(tc_t2j_general_types());