blob: 5b187fa19b68e13395e3c8c1f578a89e053e71e2 [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
Neels Hofmeyr3cf797d2018-04-05 16:56:38 +020024LD_LIBRARY_PATH="$SUITE_DIR:/usr/lib/titan:/usr/ttcn3/lib" ttcn3_start $SUITE $CFG $TEST
25
26expected="$SUITE_DIR/expected-results.log"
27if [ ! -f "$expected" ]; then
28 echo "No expected results found, not comparing outcome. ($expected)"
29 exit 0
30fi
31
32# find the most recent junit output log here
33last_log="$(ls -1tr junit*.log | tail -n 1)"
34if [ ! -f "$last_log" ]; then
35 echo "No junit log found."
36 exit 1
37fi
38
39compare="$SUITE_DIR/../compare-results.sh"
40if [ ! -x "$compare" ]; then
41 echo "ERROR: cannot find $compare"
42 exit 1
43fi
44
45set -e
46"$compare" "$expected" "$last_log" $OSMO_TTCN3_COMPARE_ARGS