about summary refs log tree commit diff stats
path: root/012transform.cc
Commit message (Expand)AuthorAgeFilesLines
* 3760 - force functions to use dependency-injectionKartik K. Agaram2017-03-071-0/+1
* 3561Kartik K. Agaram2016-10-221-2/+2
* 3555Kartik K. Agaram2016-10-221-1/+1
* 3522Kartik K. Agaram2016-10-191-6/+6
* 3520Kartik K. Agaram2016-10-181-3/+0
* 3437Kartik K. Agaram2016-10-041-1/+0
* 3436Kartik K. Agaram2016-10-041-2/+5
* 3435Kartik K. Agaram2016-10-041-0/+3
* 2882 - warn if programmer overuses transform_all()Kartik K. Agaram2016-04-281-0/+12
* 2815Kartik K. Agaram2016-03-271-1/+1
* 2799 - new approach to undoing changes in testsKartik K. Agaram2016-03-201-7/+0
* 2797 - bugfix: transform can create recipesKartik K. Agaram2016-03-191-0/+7
* 2796Kartik K. Agaram2016-03-191-5/+0
* 2775 - test rewrite-stash transformKartik K. Agaram2016-03-131-0/+5
* 2773 - switch to 'int'Kartik K. Agaram2016-03-131-5/+5
* 2728 - don't ignore /space: while checking typesKartik K. Agaram2016-03-041-0/+6
* 2494Kartik K. Agaram2015-11-281-0/+8
* 2458 - edit/: recipe side free of sandbox errorsKartik K. Agaram2015-11-181-0/+1
* 2393 - redo 2391Kartik K. Agaram2015-11-071-1/+1
* 2392 - undo 2391Kartik K. Agaram2015-11-071-1/+1
* 2391Kartik K. Agaram2015-11-071-1/+1
* 2382Kartik K. Agaram2015-11-061-0/+1
* 2374 - now edit works until layer 8Kartik K. Agaram2015-11-051-4/+0
* 2373 - bad bug: instruction was losing /lookupKartik K. Agaram2015-11-051-0/+4
* 2364Kartik K. Agaram2015-11-051-0/+10
* 2358 - starting to tackle the phaiable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/env bash

log_content()
{
    echo
    echo "Content of $1:"
    cat "$1"
}

error_handler()
{
    ERR_CODE=$?

    log_content ./config.log
    log_content ./test-suite.log

    echo
    echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting."
    echo
    exit ${ERR_CODE}
}

trap error_handler ERR

num_cores()
{
    # Check for cores, for systems with:
    #   Line 1. Linux w/ coreutils, or...
    #   Line 2. OpenBSD, FreeBSD, NetBSD or macOS, or...
    #   Line 3. Fallback for Linux w/o coreutils (glibc).
    nproc \
        || sysctl -n hw.ncpu \
        || getconf _NPROCESSORS_ONLN 2>/dev/null
}

./bootstrap.sh

tests=()
MAKE="make --quiet -j$(num_cores)"
CC="gcc"

case $(uname | tr '[:upper:]' '[:lower:]') in
    linux*)
        tests=(
        "--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
        --enable-omemo --enable-plugins --enable-c-plugins
        --enable-python-plugins --with-xscreensaver"
        "--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
        --disable-omemo --disable-plugins --disable-c-plugins
        --disable-python-plugins --without-xscreensaver"
        "--disable-notifications"
        "--disable-icons-and-clipboard"
        "--disable-otr"
        "--disable-pgp"
        "--disable-omemo"
        "--disable-pgp --disable-otr"
        "--disable-pgp --disable-otr --disable-omemo"
        "--disable-plugins"
        "--disable-python-plugins"
        "--disable-c-plugins"
        "--disable-c-plugins --disable-python-plugins"
        "--without-xscreensaver"
        "")
        ;;
    darwin*)
        tests=(
        "--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
        --enable-omemo --enable-plugins --enable-c-plugins
        --enable-python-plugins"
        "--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
        --disable-omemo --disable-plugins --disable-c-plugins
        --disable-python-plugins"
        "--disable-notifications"
        "--disable-icons-and-clipboard"
        "--disable-otr"
        "--disable-pgp"
        "--disable-omemo"
        "--disable-pgp --disable-otr"
        "--disable-pgp --disable-otr --disable-omemo"
        "--disable-plugins"
        "--disable-python-plugins"
        "--disable-c-plugins"
        "--disable-c-plugins --disable-python-plugins"
        "")
        ;;
    openbsd*)
        MAKE="gmake"
        # TODO(#1231):
        # `-std=gnu99 -fexec-charset=UTF-8` to silence:
        # src/event/server_events.c:1453:19: error: universal character names are only valid in C++ and C99
        # src/event/server_events.c:1454:19: error: universal character names are only valid in C++ and C99
        CC="egcc -std=gnu99 -fexec-charset=UTF-8"

        tests=(
        "--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
        --enable-omemo --enable-plugins --enable-c-plugins
        --enable-python-plugins"
        "--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
        --disable-omemo --disable-plugins --disable-c-plugins
        --disable-python-plugins"
        "--disable-notifications"
        "--disable-icons-and-clipboard"
        "--disable-otr"
        "--disable-pgp"
        "--disable-omemo"
        "--disable-pgp --disable-otr"
        "--disable-pgp --disable-otr --disable-omemo"
        "--disable-plugins"
        "--disable-python-plugins"
        "--disable-c-plugins"
        "--disable-c-plugins --disable-python-plugins"
        "")
        ;;
esac

for features in "${tests[@]}"
do
    echo
    echo "--> Building with ./configure ${features}"
    echo

    # shellcheck disable=SC2086
    ./configure $features

    $MAKE CC="${CC}"
    $MAKE check

    ./profanity -v
    $MAKE clean
done