Dust off the script to the new test naming.
[p5sagit/p5-mst-13.2.git] / Porting / testall.atom
1 #!/bin/sh
2
3 #
4 # testall.atom
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 the_t=`echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t; echo op/*.t pod/*.t x2p/*.t; find ../ext ../lib -name '*.t' -print`
51
52 PERL_DESTRUCT_LEVEL=2
53 export PERL_DESTRUCT_LEVEL
54 PERL_CORE=1
55 export PERL_CORE
56
57 rm -f all.Counts
58
59 for t in $the_t
60 do
61     echo $t|sed 's:\.t$::'
62     sw=''
63     case "`head -1 $t|egrep -e '^#.* -*T'`" in
64     *-T*) sw="$sw -T" ;;
65     esac
66     case "`head -1 $t|egrep -e '^#.* -t'`" in
67     *-t*) sw="$sw -t" ;;
68     esac
69     ./perl.pixie -I../lib $sw $t > /dev/null
70     if cd ..
71     then
72         if test -f all.Counts
73         then
74             prof -pixie -merge new.Counts -L. -incobj libperl.so perl t/perl.Counts all.Counts
75             mv new.Counts all.Counts
76         else
77             mv t/perl.Counts all.Counts
78         fi
79         cd t
80     fi
81 done
82
83 exit 0