File: test_config.sh

package info (click to toggle)
lnav 0.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 60,084 kB
  • sloc: cpp: 215,599; ansic: 59,220; sh: 4,650; makefile: 3,578; python: 1,197; sql: 315; xml: 264; javascript: 18
file content (44 lines) | stat: -rwxr-xr-x 1,088 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env bash

export YES_COLOR=1

export HOME="./test-config"
export XDG_CONFIG_HOME="./test-config/.config"
rm -rf ./test-config
mkdir -p $HOME/.config

# config write global var
run_cap_test ${lnav_test} -nN \
    -c ":config /global/foo bar"

# config read global var
run_cap_test ${lnav_test} -nN \
    -c ":config /global/foo"

# config bad color
run_cap_test ${lnav_test} -n \
    -c ":config /ui/theme-defs/default/styles/text/color #f" \
    ${test_dir}/logfile_access_log.0

# invalid min-free-space allowed?
rm -rf config-tmp
mkdir config-tmp
run_cap_test env TMPDIR=config-tmp ${lnav_test} -n \
    -c ':config /tuning/archive-manager/min-free-space abc' \
    ${srcdir}/logfile_syslog.0

# config bad theme
run_cap_test ${lnav_test} -n \
    -c ":config /ui/theme baddy" \
    ${test_dir}/logfile_access_log.0

# config bad theme
run_cap_test ${lnav_test} -W -n \
    -I ${test_dir}/bad-config2 \
    ${test_dir}/logfile_access_log.0

run_cap_test ${lnav_test} -nN \
    -c ":reset-config /bad/path"

run_cap_test ${lnav_test} -n -I ${test_dir} \
    hw://seattle/finn