source: utils/developer/MeasurePreprocessedFileSizes.sh@ 619ed5

Last change on this file since 619ed5 was 619ed5, checked in by Frederik Heber <heber@…>, 11 years ago

tempcommit: Extended script for other missing includes.

  • Property mode set to 100755
File size: 1.8 KB
Line 
1#!/bin/bash
2
3test ! -z "$1" || { echo "Usage: $0 <srcdir>"; exit 255; }
4SOURCEDIR=$1
5test -e $SOURCEDIR || { echo "srcdir $SOURCEDIR does not exist."; exit 255; }
6
7INCLUDES="-I$SOURCEDIR -I$SOURCEDIR/unittests -I$SOURCEDIR/Actions -I$SOURCEDIR/UIElements -I$SOURCEDIR/../LinearAlgebra/src -I$SOURCEDIR/LinearAlgebra"
8CODEPATTERNS="-I/home/heber/packages/CodePatterns-1.2.8/include"
9BOOST=""
10LEVMAR="-I/home/heber/packages/levmar-2.6/include"
11JOBMARKET="-I/home/heber/packages/JobMarket-1.1.4_1.2.8/include"
12PYTHON="-I/usr/include/python2.7"
13QT="-I/usr/include/qt4 -I/usr/include/qt4/Qt -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore"
14QWT="-I/usr/include/qwt-qt4"
15BUILDDIR="-I/home/heber/workspace_C/molecuilder/build64 -I/home/heber/workspace_C/molecuilder/build64/src"
16SCAFACOS="-I/home/heber/packages/ScaFaCoS-0.1.0-debug_open/include -I/home/heber/workspace_C/scafacos/lib/vmg/src"
17COMMON="-I/usr/include"
18MPI="-DHAVE_MPI -I/usr/include/mpi"
19
20list=`find $SOURCEDIR -name '*.cpp'`
21
22test ! -e test.cpp || { echo "There already is a test.cpp in the current dir."; exit 255; }
23
24files=0
25worlds=0
26averagesize=0
27for file in $list; do
28 CURRENTDIR=`dirname $file`
29 cpp -E -I$CURRENTDIR -I$CURRENTDIR/.. $INCLUDES $COMMON $BUILDDIR $CODEPATTERNS $JOBMARKET $BOOST $PYTHON $QT $QWT $SCAFACOS $MPI $LEVMAR -DHAVE_CONFIG_H $file >test.cpp
30 test $? -eq 0 || { echo "Some includes still missing for $file."; exit 255; }
31 lines=`wc -l test.cpp | awk -F" " '{print $1}'`
32 let averagesize=$averagesize+$lines
33 grep World.hpp $file >/dev/null
34 world=$?
35 let files=$files+1
36 let worlds=$worlds+$world
37 rm -f test.cpp
38 echo -n "`basename $file`, $lines, "
39 if test $world -eq 0; then
40 echo "0, "
41 else
42 echo "1, "
43 fi
44done
45mean=`echo "$averagesize $files" | awk -F" " '{print $1/$2}'`
46echo "$worlds of $files contain World.hpp in include tree."
47echo "The mean number of lines is $mean."
48
49exit 0
50
Note: See TracBrowser for help on using the repository browser.