7c3d3269cd294c7f47b591597e33cdf86a7d0656
[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
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
15 {
16 var charstring v_cmd := "compiler --ttcn2json " & p_args;
17 f_shellCommandWithVerdict(v_cmd, "", p_exp_result);
18
19 /* The generated schema cannot be checked this way, as different platforms generate the parts of the schema
20 in a different order
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");
25 }
26 }
27 else {
28 action("Command ", v_cmd, " failed");
29 }*/
30 }
31
32 testcase tc_t2j_one() runs on Shell_CT
33 {
34 f_test_ttcn2json("one.ttcn two.ttcn three.ttcn zero.asn", "one.json", "one_e.json",
35 c_shell_successWithWarning);
36 }
37
38 testcase tc_t2j_two() runs on Shell_CT
39 {
40 f_test_ttcn2json("one.ttcn two.ttcn three.ttcn zero.asn - two.json", "two.json", "one_e.json",
41 c_shell_successWithWarning);
42 }
43
44 testcase tc_t2j_three() runs on Shell_CT
45 {
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);
48 }
49
50 testcase tc_t2j_general_types() runs on Shell_CT
51 {
52 f_test_ttcn2json("General_Types.ttcn", "General_Types.json", "General_Types_e.json",
53 c_shell_successWithoutWarningAndError);
54 }
55
56 control {
57 execute(tc_t2j_one());
58 execute(tc_t2j_two());
59 execute(tc_t2j_three());
60 execute(tc_t2j_general_types());
61 }
62
63 }
64
This page took 0.058711 seconds and 4 git commands to generate.