• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyberShadow / aconfmgr / 363

02 Nov 2023 08:36AM UTC coverage: 80.574% (-13.1%) from 93.666%
363

push

github

CyberShadow-Renovate
Update dependency Arch Linux Base to v2023.11.01

3202 of 3974 relevant lines covered (80.57%)

138.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.86
/test/t/lib.bash
1
# aconfmgr test suite support code.
2
# Sourced by test case scripts.
3

4
# aconfmgr tests work by:
5
# - mocking operations that inspect and modify the system (see
6
#   ./lib-mocks.bash)
7
# - helper functions that set up or inspect aconfmgr's configuration /
8
#   environment / results (see ./lib-funcs.bash)
9

10
source ./lib-init.bash
88✔
11

12
for arg in "$@"
×
13
do
14
        if [[ "$arg" == -i ]]
×
15
        then
16
                if ((${ACONFMGR_INTEGRATION:-0}))
×
17
                then
18
                        printf 'Already in integration mode!\n' 1>&2
×
19
                        exit 1
×
20
                else
21
                        printf 'Re-executing in integration mode.\n' 1>&2
×
22
                        exec ../docker/run-test.sh "$ACONFMGR_CURRENT_TEST".sh
×
23
                fi
24
        else
25
                printf 'Unknown command line switch: %q\n' "$arg" 1>&2
×
26
                exit 1
×
27
        fi
28
done
29
unset arg
88✔
30

31
source ../../src/common.bash
88✔
32
source ../../src/save.bash
88✔
33
source ../../src/apply.bash
88✔
34
source ../../src/check.bash
88✔
35
source ../../src/diff.bash
88✔
36
source ../../src/helpers.bash
88✔
37

38
if [[ -v GITHUB_ACTIONS ]] ; then printf '::group::%s\n' "$test_name" 1>&2 ; fi
176✔
39
LogEnter 'Running test case %s ...\n' "$(Color C "$test_name")"
176✔
40
LogEnter 'Setting up test suite...\n'
88✔
41

42
for dir in "$config_dir" "$tmp_dir" "$test_data_dir" "$test_aur_dir"
352✔
43
do
44
        if ((${ACONFMGR_INTEGRATION:-0}))
352✔
45
        then
46
                command sudo rm -rf "$dir" # Clean up after root tests
×
47
        else
48
                rm -rf "$dir"
352✔
49
        fi
50
done
51
unset dir
88✔
52
mkdir -p "$config_dir" "$test_data_dir"
88✔
53

54
source ./lib-funcs-common.bash
88✔
55
if ((${ACONFMGR_INTEGRATION:-0}))
88✔
56
then
57
        if ! ((${ACONFMGR_IN_CONTAINER:-0}))
×
58
        then
59
                FatalError 'aconfmgr integration tests should only ever be run inside a throw-away container!''\n'
×
60
        fi
61

62
        source ./lib-funcs-integ.bash
×
63
else
64
        source ./lib-mocks.bash
88✔
65
        source ./lib-funcs-mock.bash
88✔
66
fi
67

68
# Don't use diff --color=auto when it's not available
69
if test -v BUILD_BASH && ! diff --color=auto /dev/null /dev/null 2>/dev/null
88✔
70
then
71
        diff_opts=(diff)
72
fi
73

74
TestInit
88✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc