summaryrefslogtreecommitdiff
path: root/test
blob: 73dd6130356a89642f2a1370874cc07f8e44591e (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#! /usr/bin/env bash

# Test build2 distribution.
#
# Usage: test
#
usage="usage: $0"

owd=`pwd`
trap "{ cd $owd; exit 1; }" ERR
set -o errtrace # Trap in functions.

function info () { echo "$*" 1>&2; }
function error () { info "$*"; exit 1; }

# Calculate versions.
#
tcv=`cat build2-toolchain/version`
v=`echo $tcv | sed -e 's/^\(.*\)\.\(.*\)\..*$/\1.\2/' -`

if [ -z "$v" ]; then
  error "unable to extract version from `cat build2-toolchain/version`"
fi

src=build2-$v

# Update the development build.
#
info "making sure everythings is up to date..."
b build2/ bpkg/

# Test repository with the earliest and latest (development build via
# /usr/local links) toolchains.
#
# etc1/install/0.1.0
#
for t in /usr/local; do
  cppget.org/test -t $t -n \
-c cxx \
-c config.cxx.coptions="-W -Wall -Wno-unknown-pragmas" \
-c config.cxx.poptions="-I/usr/include/apache2 -I/usr/include/apr-1.0" \
-c config.cxx.loptions=-L/usr/local/lib \
cppget.org/repository/1/
done

# Test the build2-toolchain INSTALL procedure (plus brep) with the earliest
# compiler versions we claim to support and the latest available.
#
# Note: Clang 3.4 and 3.7 are tested on FreeBSD below (3.4 cannot coexist
# with newer versions on Ubuntu).
#
for c in g++-4.8 g++-4.9 g++-5; do
  etc/install \
--cxx $c \
--cppflags "-I/usr/include/apache2 -I/usr/include/apr-1.0" \
$src/build2-toolchain-$tcv.tar.gz \
http://pkg.cppget1/1/alpha
done

# This doesn't work since libodb, etc are using libstdc++.
#
if false; then
for c in clang++-3.5 clang++-3.6; do
  etc/install \
--cxx $c \
--cppflags "-I/usr/include/apache2 -I/usr/include/apr-1.0" \
--cxxflags --stdlib=libc++ \
$src/build2-toolchain-$tcv.tar.gz \
http://pkg.cppget1/1/alpha
done
fi

# Test installation requiring sudo.
#
etc/install -t -i /opt/build2 -s $src/build2-toolchain-$tcv.tar.gz \
http://pkg.cppget1/1/alpha

# Test on FreeBSD with Clang 3.4 (default) and Clang 3.7.
#
scp etc/install $src/build2-toolchain-$tcv.tar.gz freebsd:/tmp/

for c in clang++ clang++37; do
  ssh freebsd cd /tmp ';' ./install \
--cxx $c \
--cppflags '"-I/usr/local/include/apr-1 -I/usr/local/include/apache24"' \
build2-toolchain-$tcv.tar.gz http://pkg.cppget1/1/alpha
done

# Also run the Intro steps based on the toolchain we just built.
#
scp -r hello/hello2 etc/intro freebsd:/tmp/

ssh freebsd cd /tmp ';' ./intro \
-t /tmp/build2-install          \
-c1 clang++37                   \
-c2 clang++                     \
-c3 "''"                        \
-h /tmp/hello2                  \
https://build2.org/pkg/1/hello/

# Test on Mac OS (no brep).
#
scp etc/install $src/build2-toolchain-$tcv.tar.gz rbook:/tmp/

ssh rbook cd /tmp ';' ./install -t --cxx clang++ --bpkgflags \
"'--fetch-option --resolve --fetch-option pkg.cppget1:8080:192.168.0.19'" \
build2-toolchain-$tcv.tar.gz http://pkg.cppget1:8080/1/alpha

# Again, run the Intro steps based on the toolchain we just built.
#
scp -r hello/hello2 etc/intro rbook:/tmp/

ssh rbook cd /tmp ';' ./intro   \
-t /tmp/build2-install          \
-c1 clang++                     \
-c2 "''"                        \
-c3 "''"                        \
-h /tmp/hello2                  \
https://build2.org/pkg/1/hello/