blob: d57ab99cd5944f67ae035202a21b1a1957375ac0 [file] [log] [blame]
Harald Welte5a78e102018-03-18 13:38:45 +01001#!/bin/sh
2
3# This script generates per-testcase merged logs.
4# In order to work, you need to set the following test config:
5# [LOGGING]
6# LogFile := "%e-%c-%h-%r.%s"
7#
8# the output files will be called "Module-Testcase.merged"
9
10if [ "x$1" == "x" ]; then
11 echo "You have to specify the Test Suite prefix"
12 exit 2
13fi
14
15BASE_NAME="$1"
16LOG_FILES="$BASE_NAME*.log"
17
18TEST_CASES=`ls -1 $LOG_FILES | awk 'BEGIN { FS = "-" } { print $2 }' | sort | uniq`
19
20for t in $TEST_CASES; do
21 PREFIX="$BASE_NAME-$t"
22 OUTPUT="$PREFIX.merged"
23 ttcn3_logmerge $PREFIX-*.log > $OUTPUT
24 echo "Generated $OUTPUT"
25done
26
27if [ "$2" == "--rm" ]; then
28 echo "Removing Input log files !!!"
29 rm $LOG_FILES
30fi