File: doxygenbuilder

package info (click to toggle)
cmake-extras 1.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 776 kB
  • sloc: sh: 281; cpp: 189; python: 121; xml: 24; makefile: 4
file content (54 lines) | stat: -rwxr-xr-x 1,706 bytes parent folder | download | duplicates (5)
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
#!/bin/bash

# autopkgtest check: Build a trivial project that uses the
# find_package(DoxygenBuilder) macro, verifying the output
# behaves as expected.
# (C) 2016 Canonical Ltd.
# Author: Pete Woods <pete.woods@canonical.com>

set -euo pipefail
IFS=$'\n\t'

tempdir=$(mktemp --tmpdir="${AUTOPKGTEST_TMP:-/tmp}" -d)
trap "rm -rf $tempdir" 0 INT QUIT ABRT PIPE TERM

srcdir="$(pwd)/examples/doxygenbuilder-demo"
bindir="${tempdir}/build"
installdir="${tempdir}/install"

mkdir -p "${bindir}"

# Move into bindir temporarily
(
  cd "${bindir}"
  cmake -DCMAKE_INSTALL_PREFIX="${installdir}" "${srcdir}"
  make
  make install
)

check_doc() {
  # Print using a similar format to glib-test
  echo -n "/doxygenbuilder/$1/$3: "

  xmlfile="${installdir}/share/doc/doxygenbuilder-demo/xml/$1"
  xpath="$2"
  expected="$3"

  output=$(xmllint --xpath "${xpath}" "${xmlfile}")

  if [ "${output}" == "${expected}" ]; then
    echo "OK"
  else
    echo "FAILED"
    return 1
  fi
}

check_doc 'indexpage.xml' '//compounddef/title/text()' 'DoxygenBuilder Demo'
check_doc 'indexpage.xml' '//detaileddescription/sect1/title/text()' 'Introduction'
check_doc 'indexpage.xml' '(//detaileddescription/sect1/para)[1]/text()' 'This is the introduction.'

check_doc 'classMyNamespace_1_1MyClass.xml' '(//memberdef/definition)[1]/text()' 'MyNamespace::MyClass::MyClass'
check_doc 'classMyNamespace_1_1MyClass.xml' '(//memberdef/definition)[2]/text()' 'MyNamespace::MyClass::~MyClass'
check_doc 'classMyNamespace_1_1MyClass.xml' '(//memberdef/definition)[3]/text()' 'void MyNamespace::MyClass::myMethod'
check_doc 'classMyNamespace_1_1MyClass.xml' '(//memberdef/definition)[4]/text()' 'int MyNamespace::MyClass::myOtherMethod'