File: smoketest

package info (click to toggle)
epydoc 3.0.1%2Bdfsg-14
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 17,540 kB
  • ctags: 30,686
  • sloc: python: 14,373; sh: 97; makefile: 59
file content (52 lines) | stat: -rw-r--r-- 1,336 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
#!/bin/sh

# Configure the tests to run 
TESTS="htmldocs"

# Run portions of the autopkgtest suite, with an autopkgtest-like environment
RESULT="succeeded"
for TEST in ${TESTS}; do

   # Create the $ADTTMP directory like autopkgtest
   export ADTTMP=`mktemp -d`
   if [ $? != 0 ]; then
      echo "${TEST} failed: failed to create \$ADTTMP"
      exit 1
   elif [ ! -d "${ADTTMP}" ]; then
      echo "${TEST} failed: could not create \$ADTTMP"
      exit 1
   fi

   # Create the $ADT_ARTIFACTS directory like autopkgtest
   export ADT_ARTIFACTS=`mktemp -d`
   if [ $? != 0 ]; then
      echo "${TEST} failed: failed to create \$ADT_ARTIFACTS"
      exit 1
   elif [ ! -d "${ADT_ARTIFACTS}" ]; then
      echo "${TEST} failed: could not create \$ADT_ARTIFACTS"
      exit 1
   fi

   # Execute the testcase
   TESTCASE="debian/tests/${TEST}"
   if [ ! -f "${TESTCASE}" ]; then
      echo "${TEST} failed: testcase does not exist"
      RESULT="failed"
   else
      sh ${TESTCASE} -r   # -r to run in "debian/rules" mode
      if [ $? != 0 ]; then
         echo "${TEST} failed: non-zero exit status"
         RESULT="failed"
      fi
   fi

   # Remove the temporary directories
   rm -rf ${ADTTMP}
   rm -rf ${ADT_ARTIFACTS}
done

# Exit with non-zero upon failure, to kill the build
if [ "${RESULT}" = "failed" ]; then
   exit 1
fi