blob: 0834f50b30e46a68e95a43026b57c5ed35e01629 [file] [log] [blame]
#///////////////////////////////////////////////////////////////////////////////
#// Copyright (c) 2000-2019 Ericsson Telecom AB //
#// //
#// All rights reserved. This program and the accompanying materials //
#// are made available under the terms of the Eclipse Public License v2.0 //
#// which accompanies this distribution, and is available at //
#// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html //
#///////////////////////////////////////////////////////////////////////////////
BEGIN {
FS=",[ \t]*|[ \t]+|[()]+"
currentFile=""
currentVar="ttcn3prof"
ignore=0
}
// {
print $0
}
/TTCN_Location current_location/ {
#print $0
currentFile=$3
#ignore pre_init_module (lineno==0), because the modulepar of the TTCN3Coverage was not created there:
if ($4==0) {
ignore=1
} else {
ignore=0
print "StackDepth stackDepth;"
print currentVar".enterFunction(",$3,",",$4,",",$6,");"
}
}
/current_location.update_lineno/ {
if (ignore==1) {
next
}
#print $0
#ignore duplicated lines
if(data[$0]++ == 0) {
print (currentVar".executeLine(",currentFile,",",$2,");")
}
}
/Including header files/ {
sourceFileName=""
command="gawk -f GetSourceFileName.awk "FILENAME
command | getline sourceFileName
close(command)
if (sourceFileName=="") {
next
}
print "#include \"ttcn3prof.hh\""
#to increase speed create local variable in each file:
#codelines can be determined in this case only
# split(FILENAME, file,".")
# currentVar="ttcn3prof_"file[1];
# #determine the number of code lines:
# getCodeLines="gawk -f CodeLineCount.awk "FILENAME" | grep CodeLines | gawk '{print $3}'";
# #print codeLines
# print "TTCN3PROF "currentVar"(\""file[1]"\","
# system(getCodeLines)
# print");"
}
END {
}