File: test_installed.sh

package info (click to toggle)
gprbuild 2011-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 10,396 kB
  • sloc: ada: 94,726; sh: 2,818; xml: 2,225; makefile: 471; ansic: 240; cpp: 89; fortran: 62; asm: 27
file content (52 lines) | stat: -rwxr-xr-x 1,575 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#
# install gprbuild package (normally in the chroot that just built it),
# and run the examples using it.

# usage
# cd gprbuild-<version>/debian
# schroot ./test_installed.sh

# We want to test that gprbuild doesn't depend on the current gcc,
# only on current gcc-x.y, because if someone installs gprbuild on a
# 'testing' system that has only gcc-4.3, gcc will stay pointing at
# gcc-4.3. To do that, we install both and old and the current version
# of gcc-x.y, and delete the symlink gcc. Similarly, we don't install
# 'g++', but rather 'g++-4.6', etc.
sudo rm /usr/bin/gcc

upstreamversion=`dpkg-parsechangelog -lchangelog | sed -r -n -e "s/^Version: ([0123456789.]+)-[0123456789]+$/\1/p"`
debversion=`dpkg-parsechangelog -lchangelog | sed -r -n -e "s/^Version: [0123456789.]+-([0123456789]+)$/\1/p"`

# This re-installs the latest version.
sudo dpkg --install ../../gprbuild_${upstreamversion}-${debversion}_i386.deb
sudo dpkg --install ../../gprbuild-doc_${upstreamversion}-${debversion}_all.deb

# tmp is owned by root; we need write permission
sudo chmod -R o+w tmp

cd ../examples
make

# test gprclean
make clean

# test running gprbuild with the default config file
cd first_steps
gprbuild -Pc_main
gprbuild -Pada_main

# clean up for next build
make clean

# test that default gpr search path follows Debian Ada policy
cd ../../debian
gprbuild -P aunit_example
gprclean -P aunit_example

# test that -s (check switches) doesn't attempt to write in system directories
gprbuild bug_571013.gpr

sudo ln -s /usr/bin/gcc-4.6 /usr/bin/gcc

# end of file