Debian Codegraph @

regression_test/logFiles/diffLogs

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 function changeFilescip-shell shell shell-project 0.0.0 changeFile(). {
4 # This will need improvement...
5 sedscip-shell system . . sed. -i 's/The address of MC.*/The address of MC deletedPart/g' $1
6 sedscip-shell system . . sed. -i 's/Process id:.[0-9]*/Process id: deletedPart/g' $1
7 sedscip-shell system . . sed. -i 's/process id:.[0-9]*/process id: deletedPart/g' $1
8 sedscip-shell system . . sed. -i 's/operations:.[0-9]*/operations: deletedPart/g' $1
9 sedscip-shell system . . sed. -i 's/context switches:.[0-9]*/context switches: deletedPart/g' $1
10 sedscip-shell system . . sed. -i 's/time:..[0-9]*\..[0-9]*/time: deletedPart/g' $1
11 sedscip-shell system . . sed. -i 's/ttcn3-portconn.*/ttcn3-portconn deletedPart/g' $1
12 sedscip-shell system . . sed. -i 's/ - / /g' $1
13 sedscip-shell system . . sed. -i 's/Version:..[0-9]*\..[0-9]*\..*\./Version: deletedPart/g' $1
14 sedscip-shell system . . sed. -i 's/size:..[0-9]*/size: deletedPart/g' $1
15 sedscip-shell system . . sed. -i 's/I\/O:..[0-9]*/I\/O: deletedPart/g' $1
16 }
17
18 if [scip-shell system . . `[`. "$1" = "-h" ]; then
19 echoscip-shell system . . echo. "Usage diffLogs dir1/ dir2/"
20 echoscip-shell system . . echo. "In case of no params, . will be used"
21 echoscip-shell system . . echo. "The aim of this script is to compare ttcn3 log files made with different titan versions."
22 echoscip-shell system . . echo. "The .diff and .lo2 files are generated into dir1/"
23 exit 1
24 fi
25
26 if [scip-shell system . . `[`. "$1" = "" ]; then
27 MYVAL="."
28 echoscip-shell system . . echo. "Will use . as start"
29 else
30 MYVAL=$1
31 fi
32
33 if [scip-shell system . . `[`. ! -d "$1" ]; then
34 echoscip-shell system . . echo. "$1 does not exists"
35 exit 1
36 fi
37
38 findscip-shell system . . find. $MYVAL -maxdepth 1 -type f \( -name "*.log" \) -print0 | while read -d $'\0' file
39 do
40 cutscip-shell system . . cut. -d' ' -f3- $file > "${file%%.???}.lo2"
41 changeFilescip-shell shell shell-project 0.0.0 changeFile(). "${file%%.???}.lo2"
42 done
43
44
45 if [scip-shell system . . `[`. "$2" != "" ]; then
46 if [scip-shell system . . `[`. ! -d "$2" ]; then
47 echoscip-shell system . . echo. "$2 does not exists"
48 exit 1
49 fi
50
51 rmscip-shell system . . rm. -f $1/*.diff
52
53 MYVAL=$2
54 findscip-shell system . . find. $MYVAL -maxdepth 1 -type f \( -name "*.log" \) -print0 | while read -d $'\0' file
55 do
56 cutscip-shell system . . cut. -d' ' -f3- $file > "${file%%.???}.lo2"
57 changeFilescip-shell shell shell-project 0.0.0 changeFile(). "${file%%.???}.lo2"
58 basename=`basenamescip-shell system . . basename. "$file"`
59
60 diffscip-shell system . . diff. "${file%%.???}.lo2" $1/${basename%.*}.lo2 >> $1/${basename%.*}.diff
61
62 if [scip-shell system . . `[`. -s "$1/${basename%.*}.diff" ]; then
63 echoscip-shell system . . echo. "File differs.. : " $1${basename%.*}.diff
64 echoscip-shell system . . echo. "File differs.. : " $1${basename%.*}.diff >> $1/diffLogs.diff
65 fi
66 done
67
68 if [scip-shell system . . `[`. ! -s $1/diffLogs.diff ]; then
69 echoscip-shell system . . echo. "Log Files are identical, yuhu!!"
70 exit 0
71 else
72 exit 1
73 fi
74 fi