• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/bash
2#                          __  __            _
3#                       ___\ \/ /_ __   __ _| |_
4#                      / _ \\  /| '_ \ / _` | __|
5#                     |  __//  \| |_) | (_| | |_
6#                      \___/_/\_\ .__/ \__,_|\__|
7#                               |_| XML parser
8#
9# Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
10# Copyright (c) 2017      Rolf Eike Beer <eike@sf-mail.de>
11# Copyright (c) 2019      Mohammed Khajapasha <mohammed.khajapasha@intel.com>
12# Copyright (c) 2019      Manish, Kumar <manish3.kumar@intel.com>
13# Copyright (c) 2019      Philippe Antoine <contact@catenacyber.fr>
14# Licensed under the MIT license:
15#
16# Permission is  hereby granted,  free of charge,  to any  person obtaining
17# a  copy  of  this  software   and  associated  documentation  files  (the
18# "Software"),  to  deal in  the  Software  without restriction,  including
19# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
20# distribute, sublicense, and/or sell copies of the Software, and to permit
21# persons  to whom  the Software  is  furnished to  do so,  subject to  the
22# following conditions:
23#
24# The above copyright  notice and this permission notice  shall be included
25# in all copies or substantial portions of the Software.
26#
27# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
28# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
29# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
30# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
31# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
32# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
33# USE OR OTHER DEALINGS IN THE SOFTWARE.
34
35set -e
36
37if [[ ${RUNNER_OS} = macOS ]]; then
38    latest_brew_python3_bin="$(ls -1d /usr/local/Cellar/python/3.*/bin | sort -n | tail -n1)"
39    export PATH="${latest_brew_python3_bin}${PATH:+:}${PATH}"
40    export PATH="/usr/local/opt/coreutils/libexec/gnubin${PATH:+:}${PATH}"
41    export PATH="/usr/local/opt/findutils/libexec/gnubin${PATH:+:}${PATH}"
42elif [[ ${RUNNER_OS} = Linux ]]; then
43    export PATH="/usr/lib/llvm-18/bin:${PATH}"
44else
45    echo "Unsupported RUNNER_OS \"${RUNNER_OS}\"." >&2
46    exit 1
47fi
48
49echo "New \${PATH}:"
50tr : '\n' <<<"${PATH}" | sed 's,^,- ,'
51echo
52
53PS4='# '
54set -x
55
56cd expat
57./buildconf.sh
58
59if [[ ${MODE} = distcheck ]]; then
60    ./configure ${CONFIGURE_ARGS}
61    make distcheck
62elif [[ ${MODE} = cmake-oos ]]; then
63    mkdir build
64    cd build
65    cmake ${CMAKE_ARGS} ..
66    make VERBOSE=1 CTEST_OUTPUT_ON_FAILURE=1 all test
67    make DESTDIR="${PWD}"/ROOT install
68    find ROOT -printf "%P\n" | sort
69elif [[ ${MODE} = coverage-sh ]]; then
70    ./coverage.sh
71else
72    ./qa.sh ${CMAKE_ARGS}
73fi
74