Debian Codegraph @

test/compile-test.sh

raw symbols SCIP
1 #!/bin/bash
2 #
3 # Copyright (C) 2017 - 2022, Stephan Mueller <[email protected]>
4 #
5 # License: see LICENSE file in root directory
6 #
7 # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
9 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
10 # WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
11 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
12 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
13 # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
14 # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
15 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
16 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
17 # USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
18 # DAMAGE.
19 #
20 # This test tries to compile all code and tries to install it
21 #
22
23 DIRNAME="$(dirname "$0")"
24 . "$DIRNAME/libtest.sh"
25
26 if [ "$KCAPI_TEST_LOCAL" -ne 1 ]; then
27 echo "Compile test can only be run in a local test!"
28 exit 1
29 fi
30
31 INSTALLTARGET="$(pwd)/tmp-install"
32
33 check_result()
34 {
35 local result=$1
36 shift
37 local info=$@
38
39 if [ $result -eq 0 ]
40 then
41 echo_pass $info
42 else
43 echo_fail $result $info
44 failures=$(($failures+1))
45 exit $result
46 fi
47 }
48
49 trap "rm -rf $INSTALLTARGET; exit" 0 1 2 3 15
50
51 mkdir -p $INSTALLTARGET
52 cd "$DIRNAME/.."
53 make distclean > /dev/null 2>&1
54 ./configure --enable-kcapi-test \
55 --enable-kcapi-speed \
56 --enable-kcapi-hasher \
57 --enable-kcapi-rngapp \
58 --enable-kcapi-encapp \
59 --enable-kcapi-dgstapp \
60 --enable-lib-asym \
61 --enable-lib-kpp \
62 --prefix=$INSTALLTARGET
63 check_result $? "configure"
64
65 make -j8; check_result $? "make -j8"
66 make install; check_result $? "make install"
67 make pdf; check_result $? "make pdf"
68 make man; check_result $? "make man"
69 make ps; check_result $? "make ps"
70 make html; check_result $? "make html"
71 make distclean; check_result $? "make distclean"
72
73 check_result $failures "Final result"