File: run-unit-test

package info (click to toggle)
gifticlib 1.0.9-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 832 kB
  • sloc: ansic: 13,453; csh: 81; makefile: 41; sh: 26
file content (42 lines) | stat: -rw-r--r-- 1,143 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
set -e

pkg=libgiftiio0

export LC_ALL=C.UTF-8
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

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

cd "${AUTOPKGTEST_TMP}"

# Note the .gii file is an xml file recording the endianness of the system
# on which it has been created, thus altering the check sum.  Other values
# should not change.
BYTE_ORDER="$(lscpu | sed -n 's/^Byte Order: \+//p')"
if [ "$BYTE_ORDER" = "Little Endian" ]
then
	echo "0e12f6982c15198137cde8def420f9d5  created.gii" >> checksums
elif [ "$BYTE_ORDER" = "Big Endian" ]
then
	echo "aec3bec6d80e76f10b4e33f6470cc3cb  created.gii" >> checksums
else
	echo "error: unknown byte order: '$BYTE_ORDER'" >&2
	exit 1
fi

echo -e "\e[93m\e[1mRunning Tests....\e[0m"

gifti_test -infile new.gii -show

gifti_tool -new_dset -new_numDA 3 -new_dtype NIFTI_TYPE_INT16  -new_intent NIFTI_INTENT_TTEST  -new_ndim 2 -new_dims 5 2 0 0 0 0 -mod_add_data -write_gifti created.gii

md5sum --check checksums

rm created.gii

echo -e "\e[92m\e[1mPASS\e[0m"