File: upstream-tests

package info (click to toggle)
sysstat 12.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,156 kB
  • sloc: ansic: 49,310; sh: 1,388; xml: 1,285; makefile: 768; tcl: 756; python: 277; perl: 257
file content (68 lines) | stat: -rwxr-xr-x 1,662 bytes parent folder | download
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
#!/bin/bash
# vim: sw=2:ts=2:sts=2:et

set -ex

# First argument is test_type: pristine-source or with-debian-patches.
# Remaining arguments are names of arches on which that the test should
# pass,  n other archs it will be marked as skippable
readonly test_type="$1"
shift

readonly arch=$(dpkg-architecture -q DEB_HOST_ARCH)

readonly tmpdir="${AUTOPKGTEST_TMP:-$(mktemp -d)}"
trap "rm -rf $tmpdir" EXIT INT QUIT TERM


cd  "$(readlink -e "$(dirname $0)/../..")"
tar cf -  \
	--exclude "*.bak" \
	--exclude "*.gmo" \
	--exclude "*.o" \
	--exclude "*.so" \
	--exclude "*.tmp" \
	--exclude "*~"  \
	--exclude ".debhelper*" \
	--exclude ".git*" \
  . | tar xvf - -C "$tmpdir"

cd "$tmpdir"

ignore_arg=""

if [ "$test_type" = "pristine-source" ] ; then
  dpkg-source --after-build --unapply-patches .
elif [ "$test_type" = "with-debian-patches" ] ; then
  dpkg-source --before-build .

  # Revert change done by 04-configs.patch
  echo 'SADC_OPTIONS="@COLLECT_ALL@ @SADC_OPT@"' >> sysstat.sysconfig.in
  ignore_arg="ignore"

  export CFLAGS="$(dpkg-buildflags --get CFLAGS) $(getconf LFS_CFLAGS)"
  export CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS)
  export LDFLAGS=$(dpkg-buildflags --get LDFLAGS)

  autoreconf -i -s
else
  echo "Unknown test type: $test_type" >&2
  exit 1
fi

ln -svf sar sar.sysstat
set -o pipefail

! bash ./do_test all $ignore_arg 2>&1 | tee tests/do_test.log || exit 0

cd "$tmpdir/tests"
shopt -s nullglob

[ ! -d "$AUTOPKGTEST_ARTIFACTS" ] || \
  tar cvzf "$AUTOPKGTEST_ARTIFACTS/output-files-$test_type-$arch.tgz" do_test.log *.tmp || :

for non_skippable_arch in "$@"; do
  [ "$arch" = "$non_skippable_arch" ] && exit 3
done

exit 77