Skip to content

Commit 120fcf7

Browse files
committed
Add test script for make install when prefix and DESTDIR are used
1 parent d4f4eb7 commit 120fcf7

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

test/tst_install.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/sh
2+
3+
# This requires one command-line option, the installation path
4+
if [ "x$1" = x ] ; then
5+
echo "Usage: $0 /pnetcdf/install/path"
6+
exit 1
7+
fi
8+
9+
installation_path=$1
10+
11+
# check if pnetcdf_version exists in the install folder
12+
if [ ! -x $installation_path/bin/pnetcdf_version ]; then
13+
echo "Error: pnetcdf_version not found in $installation_path/bin"
14+
exit 1
15+
fi
16+
17+
# check if pnetcdf.pc exists in the install folder
18+
if [ ! -f $installation_path/lib/pkgconfig/pnetcdf.pc ]; then
19+
echo "Error: pnetcdf.pc not found in $installation_path/lib/pkgconfig"
20+
exit 1
21+
fi
22+
23+
# check if pnetcdf-config exists in the install folder
24+
if [ ! -x $installation_path/bin/pnetcdf-config ]; then
25+
echo "Error: pnetcdf-config not found in $installation_path/bin"
26+
exit 1
27+
else
28+
# check if --prefix is correctly reflecting the install path
29+
prefixdir=`$installation_path/bin/pnetcdf-config --prefix`
30+
if [ $prefixdir != $installation_path ] ; then
31+
echo "Error: expecting '$installation_path' from 'pnetcdf-config --prefix' but got $prefixdir"
32+
fi
33+
# check if --libdir is correctly reflecting the install path
34+
libdir=`$installation_path/bin/pnetcdf-config --libdir`
35+
if [ $libdir != $installation_path/lib ] ; then
36+
echo "Error: expecting '$installation_path/lib' from 'pnetcdf-config --libdir' but got $libdir"
37+
fi
38+
# check if --includedir is correctly reflecting the install path
39+
incdir=`$installation_path/bin/pnetcdf-config --includedir`
40+
if [ $incdir != $installation_path/include ] ; then
41+
echo "Error: expecting '$installation_path/include' from 'pnetcdf-config --includedir' but got $incdir"
42+
fi
43+
fi
44+

0 commit comments

Comments
 (0)