File: runExamples

package info (click to toggle)
hmat-oss 1.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,188 kB
  • sloc: cpp: 13,255; ansic: 1,416; sh: 33; makefile: 12
file content (46 lines) | stat: -rw-r--r-- 1,133 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
set -e

pkg=libhmat-oss-dev

export LC_ALL=C.UTF-8
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  # Double quote below to expand the temporary directory variable now versus
  # later is on purpose.
  # shellcheck disable=SC2064
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cp -a /usr/share/doc/${pkg}/examples "${AUTOPKGTEST_TMP}"

# We are going to run the C examples that are provided with the package.

cd "${AUTOPKGTEST_TMP}/examples"
gcc -Wall -O3 -o c-cholesky c-cholesky.c -lhmat -lm
./c-cholesky 10 D
if [ $? -eq 0 ]; then
    echo "Test c-cholesky PASSED"
fi
echo ""

gcc -Wall -O3 -o c-cylinder c-cylinder.c -lhmat -lm
./c-cylinder 100 C
if [ $? -eq 0 ]; then
    echo "Test c-cylinder PASSED"
fi
echo ""

gcc -Wall -O3 -o c-simple-cylinder c-simple-cylinder.c -lhmat -lm
./c-simple-cylinder 25 Z
if [ $? -eq 0 ]; then
    echo "Test c-simple-cylinder PASSED"
fi
echo ""

gcc -Wall -O3 -o c-simple-kriging c-simple-kriging.c -lhmat -lm
./c-simple-kriging points.txt S
if [ $? -eq 0 ]; then
    echo "Test c-simple-kriging PASSED"
fi
echo ""