| 1 | #!/bin/sh |
| 2 | |
| 3 | # |
| 4 | # testall.atom - test suite profiling on Tru 64 |
| 5 | # |
| 6 | # This script creates all.Counts file that can be fed to prof(1) |
| 7 | # to produce various basic block counting profiles. |
| 8 | # |
| 9 | # This script needs to be run at the top level of the Perl build |
| 10 | # directory after the "make all" and "make test" targets have been run. |
| 11 | # |
| 12 | # You will also need to have perl.pixie built, |
| 13 | # which means that you will also have Configured with -Doptimize=-g. |
| 14 | # |
| 15 | # After the script has been run (this will take several minutes) |
| 16 | # you will have a file called all.Counts, which contains the cumulative |
| 17 | # basic block counting results over the whole Perl test suite. |
| 18 | # You can produce various reports using prof(1); |
| 19 | # |
| 20 | # prof -pixie -all -L. perl all.Counts |
| 21 | # prof -pixie -heavy -all -L. perl all.Counts |
| 22 | # prof -pixie -invocations -all -L. perl all.Counts |
| 23 | # prof -pixie -lines -all -L. perl all.Counts |
| 24 | # prof -pixie -testcoverage -all -L. perl all.Counts |
| 25 | # prof -pixie -zero -all -L. perl all.Counts |
| 26 | # |
| 27 | # io/openpid and op/fork core on me, I don't know why and haven't |
| 28 | # taken a look yet. |
| 29 | # |
| 30 | # jhi@iki.fi |
| 31 | # |
| 32 | |
| 33 | if test ! -f /usr/bin/atom |
| 34 | then |
| 35 | echo "$0: no /usr/bin/atom" |
| 36 | exit 1 |
| 37 | fi |
| 38 | |
| 39 | if test ! -f perl; then echo "$0: no perl"; exit 1; fi |
| 40 | if test ! -f perl.pixie; then echo "$0: no perl.pixie; exit 1; fi |
| 41 | if test ! -f t/perl; then echo "$0: no t/perl; exit 1; fi |
| 42 | |
| 43 | LD_LIBRARY_PATH=`pwd` |
| 44 | export LD_LIBRARY_PATH |
| 45 | |
| 46 | cd t || exit 1 |
| 47 | |
| 48 | ln -sf ../perl.pixie . |
| 49 | |
| 50 | if test $# = 0; then |
| 51 | the_t=`echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t; echo op/*.t uni/*.t pod/*.t x2p/*.t; find ../ext ../lib -name '*.t' -print` |
| 52 | else |
| 53 | the_t=$@ |
| 54 | fi |
| 55 | |
| 56 | PERL_DESTRUCT_LEVEL=2 |
| 57 | export PERL_DESTRUCT_LEVEL |
| 58 | PERL_CORE=1 |
| 59 | export PERL_CORE |
| 60 | |
| 61 | rm -f all.Counts |
| 62 | |
| 63 | for t in $the_t |
| 64 | do |
| 65 | case "$t" in |
| 66 | ext/*|lib/*) t=../$t ;; |
| 67 | t/*) t=`echo $t|sed 's:^t/::'` ;; |
| 68 | esac |
| 69 | echo $t|sed 's:\.t$::' |
| 70 | sw='' |
| 71 | case "`head -1 $t|egrep -e '^#.* -.*T'`" in |
| 72 | *-*T*) sw="$sw -T" ;; |
| 73 | esac |
| 74 | case "`head -1 $t|egrep -e '^#.* -.*t'`" in |
| 75 | *-*t*) sw="$sw -t" ;; |
| 76 | esac |
| 77 | ./perl.pixie -I../lib $sw $t > /dev/null |
| 78 | if cd .. |
| 79 | then |
| 80 | if test -f all.Counts |
| 81 | then |
| 82 | prof -pixie -merge new.Counts -L. -incobj libperl.so perl t/perl.Counts all.Counts |
| 83 | mv new.Counts all.Counts |
| 84 | else |
| 85 | mv t/perl.Counts all.Counts |
| 86 | fi |
| 87 | cd t |
| 88 | fi |
| 89 | done |
| 90 | |
| 91 | exit 0 |