blob: 31bc891c2fe15d4a2b2d04036a8756aa02c3268a [file] [log] [blame]
Harald Welte4d772292017-08-19 15:27:10 +02001#!/bin/sh
2
3# Helper script to starte a TITAN-generated test suite, supporting
4# dynamically linked suites to ensure JUNIT generation is possible.
5
6if [ $# -lt 1 ]; then
7 echo "You have to specify the test suite name"
8 echo "Syntax example: $0 osmo-ttcn3-hacks/ggsn_tests/GGSN_Test ./GGSN_Test.cfg"
9 exit 1
10fi
11
12SUITE=$1
Neels Hofmeyr3cf797d2018-04-05 16:56:38 +020013SUITE_DIR="$(dirname "$SUITE")"
14SUITE_NAME="$(basename "$SUITE")"
15CFG="$SUITE_NAME.cfg"
Harald Welte4d772292017-08-19 15:27:10 +020016if [ $# -gt 1 ]; then
17 CFG=$2
18fi
19
Daniel Willmann47fb0f42018-02-02 20:09:00 +010020if [ $# -gt 2 ]; then
21 TEST=$3
22fi
23
Vadim Yanitskiyb3992812019-06-04 22:11:04 +070024TITAN_LIBRARY_PATH="/usr/lib/titan:/usr/ttcn3/lib"
25LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SUITE_DIR:$TITAN_LIBRARY_PATH" ttcn3_start $SUITE $CFG $TEST
Neels Hofmeyr3cf797d2018-04-05 16:56:38 +020026
Neels Hofmeyr1fd66792018-04-11 14:53:28 +020027expected="$SUITE_DIR/expected-results.xml"
Neels Hofmeyr3cf797d2018-04-05 16:56:38 +020028if [ ! -f "$expected" ]; then
29 echo "No expected results found, not comparing outcome. ($expected)"
30 exit 0
31fi
32
33# find the most recent junit output log here
34last_log="$(ls -1tr junit*.log | tail -n 1)"
35if [ ! -f "$last_log" ]; then
36 echo "No junit log found."
37 exit 1
38fi
39
40compare="$SUITE_DIR/../compare-results.sh"
41if [ ! -x "$compare" ]; then
42 echo "ERROR: cannot find $compare"
43 exit 1
44fi
45
Neels Hofmeyr3cf797d2018-04-05 16:56:38 +020046"$compare" "$expected" "$last_log" $OSMO_TTCN3_COMPARE_ARGS