aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/run_tests.sh
blob: 2447bd4c16951b819c1ed2e507c15210b7ee01b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

HERE="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
cd $HERE/..

run() {
    nvim --headless --noplugin -u scripts/minimal_init.lua \
        -c "PlenaryBustedDirectory $1 { minimal_init = './scripts/minimal_init.lua' }"
}

if [[ $1 = '--summary' ]]; then
    # really simple results summary by filtering plenary busted output
    run tests/indent/ 2> /dev/null | grep -E '^\S*(Success|Fail(ed)?|Errors?)'
elif [[ $1 = '--unit' ]]; then
    run tests/unit
else
    run tests/indent/
fi