root/other/dsss-testing-framework/test.sh

Revision 803, 3.9 kB (checked in by Gregor, 1 year ago)

--

  • Property svn:executable set to *
Line 
1 #!/bin/bash -x
2 ORIGPATH="$PATH"
3
4 . plats.sh
5
6 # Get the list of packages
7 PKGS=""
8 for i in `/opt/dsss-test/$PRIMARY_PLAT/bin/dsss net --source=http://svn.dsource.org/projects/dsss/sources list | sed 's/ /_/g'`
9 do
10     if [ "$i" != "Synchronizing..." -a \
11          ! "`echo $i | grep 'dsss'`" -a \
12          ! "`echo $i | grep 'dmd'`" -a \
13          ! "`echo $i | grep 'gdc'`" -a \
14          ! "`echo $i | grep 'tango'`" -a \
15          ! "`echo $i | grep '^\+ '`" ]
16     then
17         PKGS="$PKGS $i"
18     fi
19 done
20
21 # Then download them
22 mkdir -p pkgs
23 #rm -f pkgs/*
24 cd pkgs
25 if [ 1 = 0 ] ; then
26 for i in $PKGS
27 do
28     /opt/dsss-test/$PRIMARY_PLAT/bin/dsss net fetch $i
29 done
30 /opt/dsss-test/$PRIMARY_PLAT/bin/dsss net fetch tango
31 fi
32
33 # Finally, make a source list to use the local copies
34 cp -f /opt/dsss-test/$PRIMARY_PLAT/share/dsss/sources/* .
35 echo > source.list
36 for i in $PKGS
37 do
38     echo $i' tgz file://'`pwd`'/'$i'.tar.gz' >> source.list
39 done
40 echo 'tango tgz file://'`pwd`'/tango.tar.gz' >> source.list
41
42 cd .. || exit 1
43
44 SOURCE='file://'`pwd`'/pkgs'
45
46 runtests() {
47     lib="$1"
48
49     # For each configuration ...
50     for i in $PLATS
51     do
52         ORIGPATH="$PATH"
53         export PATH="/opt/dsss-test/$i/bin:$PATH"
54
55         # Set up rebuild/default
56         if [ "$lib" = "phobos" ]
57         then
58             perl -pe 's/-tango//g' -i /opt/dsss-test/$i/etc/rebuild/default
59         else
60             perl -pe 's/profile=(.*)$/profile=\1-tango/ ; s/-tango-tango/-tango/g' -i /opt/dsss-test/$i/etc/rebuild/default
61         fi
62
63         rm -rf /opt/dsss-test/$i/tests-$lib
64         mkdir -p /opt/dsss-test/$i/tests-$lib
65         touch /opt/dsss-test/$i/tests-$lib/UNITFAILS
66
67         # Uninstall old garbage
68         for j in `dsss installed`
69         do
70             if [ "$j" != "dsss" -a "$j" != "tango" -a "$j" != "tangobos" ]
71             then
72                 dsss uninstall $j
73             fi
74         done
75
76         # Make the build directory
77         mkdir -p build || exit 1
78         cd build || exit 1
79         rm -rf * || exit 1
80
81         # For each package
82         for j in $PKGS
83         do
84             echo $i $j
85             rm -rf /tmp/DSSS_*
86
87             # Get it
88             dsss net --source=$SOURCE fetch $j || exit 1
89             tar zxf $j.tar.gz || exit 1
90             dsss net --source=$SOURCE deps >& /dev/null
91
92             # Build it
93             dsss build --doc -v >& /opt/dsss-test/$i/tests-$lib/$j &&
94                 dsss install >& /dev/null
95
96             # Test it
97             if [ "`echo $NATIVE_PLATS | grep $i`" ]
98             then
99                 ( dsss build --test -v >> /opt/dsss-test/$i/tests-$lib/$j 2>&1 ||
100                     echo $j >> /opt/dsss-test/$i/tests-$lib/UNITFAILS ) &
101                 sleep 60 &
102                 while [ true ]
103                 do
104                     sleep 5
105                     if [ "`jobs | wc -l`" = "2" ]
106                     then
107                         continue
108                     fi
109                     kill -9 %1 >& /dev/null
110                     kill -9 %2 >& /dev/null
111             wait
112             break
113                 done
114             fi
115
116             # Clean up
117             rm -rf *
118         done
119
120         # Leave the build directory
121         cd .. || exit 1
122         rm -rf build || exit 1
123
124         dsss installed >& /opt/dsss-test/$i/tests-$lib/LIST
125
126         # Copy in the docs from this build
127         yes n | cp -ai /opt/dsss-test/$i/share/doc docs
128
129         export PATH="$ORIGPATH"
130     done
131 }
132
133 # Prepare to copy in docs
134 rm -rf docs
135
136 #./untango.sh
137 #runtests phobos
138 #for i in $PLATS
139 #do
140 #    echo $i tango
141 #    yes | PATH="/opt/dsss-test/$i/bin:$PATH" dsss net --source=$SOURCE install tango
142 #done
143 #runtests tango
144 ./tangobosify.sh
145 runtests tangobos
146
147 # Set up candydoc links
148 cd docs
149 cp -af dsss/sss/candydoc .
150 for i in *
151 do
152     if [ "$i" = "candydoc" ]
153     then
154         continue
155     fi
156     for j in `find $i -name candydoc`
157     do
158         rm -rf $j
159         ln -s `dirname $j | sed 's/[^\/]*/../g'`/candydoc $j
160     done
161 done
Note: See TracBrowser for help on using the browser.