File: jtdiff-autopkgtest.in

package info (click to toggle)
openjdk-11 11.0.28%2B6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 781,124 kB
  • sloc: java: 5,208,481; xml: 1,192,267; cpp: 1,138,346; ansic: 461,925; javascript: 162,416; sh: 16,738; objc: 13,729; python: 4,757; asm: 3,570; makefile: 2,965; perl: 357; awk: 351; sed: 172; jsp: 24; csh: 3
file content (58 lines) | stat: -rwxr-xr-x 2,001 bytes parent folder | download | duplicates (17)
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
#!/bin/bash
set -o errexit
set -o errtrace
set -o pipefail
set -o nounset

testsuite=$1
shift

if [ -z "${AUTOPKGTEST_TMP+x}" ] || [ -z "${AUTOPKGTEST_ARTIFACTS+x}" ]; then
  echo "Environment variables AUTOPKGTEST_TMP and AUTOPKGTEST_ARTIFACTS must be set" >&2
  exit 1
fi

host_arch=${DEB_HOST_ARCH:-$(dpkg --print-architecture)}

if grep -q -w "${host_arch}" debian/tests/hotspot-archs; then
  default_vm=hotspot
else
  default_vm=zero
fi

vmname=${VMNAME:-${default_vm}}

jt_report_tb="@doc_dir@/test-${host_arch}/jtreport-${vmname}.tar.gz"

if [ ! -f "${jt_report_tb}" ]; then
  echo "Unable to compare jtreg results: no build jtreport found for ${vmname}/${host_arch}."
  echo "Reason: '${jt_report_tb}' does not exist."
  exit 77
fi

# create directories to hold the results
mkdir -p "${AUTOPKGTEST_ARTIFACTS}/${testsuite}"
mkdir -p "${AUTOPKGTEST_TMP}/openjdk-pkg-jtreg-report"

current_report_dir="${AUTOPKGTEST_ARTIFACTS}/${testsuite}"
previous_report_dir="${AUTOPKGTEST_TMP}/openjdk-pkg-jtreg-report/${testsuite}"

# extract testsuite results from openjdk package
[ -d "${previous_report_dir}" ] || \
  tar -xf "${jt_report_tb}" --strip-components=1 -C "${AUTOPKGTEST_TMP}/openjdk-pkg-jtreg-report"


jtdiff -o "${current_report_dir}/jtdiff.html" "${previous_report_dir}/JTreport" "${current_report_dir}/JTreport" || true
jtdiff "${previous_report_dir}/JTreport" "${current_report_dir}/JTreport" | tee "${current_report_dir}/jtdiff.txt" || true

# create jdiff super-diff structure
jtdiff_dir="${AUTOPKGTEST_TMP}/jtdiff-${testsuite}/${host_arch}"
mkdir -p "${jtdiff_dir}/"{1,2} "${current_report_dir}/jtdiff-super"
ln -sf "${previous_report_dir}/"[0-9] "${jtdiff_dir}/1/"
ln -sf "${current_report_dir}/"[0-9] "${jtdiff_dir}/2/"

# run jtdiff super-diff
jtdiff -o "${current_report_dir}/jtdiff-super/" -s "${AUTOPKGTEST_TMP}/jtdiff-${testsuite}/" || true

# fail if we detect a regression
if egrep '^(pass|---) +(fail|error)' "${current_report_dir}/jtdiff.txt"; then exit 1; else exit 0; fi