2019-05-03 23:50:19 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-04-30 23:05:42 +03:00
|
|
|
export YES_COLOR=1
|
|
|
|
|
2019-08-07 19:46:19 +03:00
|
|
|
export HOME="./test-config"
|
2021-08-29 17:35:55 +03:00
|
|
|
export XDG_CONFIG_HOME="./test-config/.config"
|
2019-08-07 19:46:19 +03:00
|
|
|
rm -rf ./test-config
|
|
|
|
mkdir -p $HOME/.config
|
|
|
|
|
2022-04-30 23:05:42 +03:00
|
|
|
# config write global var
|
|
|
|
run_cap_test ${lnav_test} -nN \
|
2021-05-20 08:05:21 +03:00
|
|
|
-c ":config /global/foo bar"
|
|
|
|
|
2022-04-30 23:05:42 +03:00
|
|
|
# config read global var
|
|
|
|
run_cap_test ${lnav_test} -nN \
|
2021-05-20 08:05:21 +03:00
|
|
|
-c ":config /global/foo"
|
|
|
|
|
2022-04-30 23:05:42 +03:00
|
|
|
# config bad color
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2019-05-03 23:50:19 +03:00
|
|
|
-c ":config /ui/theme-defs/default/styles/text/color #f" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 23:05:42 +03:00
|
|
|
# invalid min-free-space allowed?
|
2024-05-22 16:18:35 +03:00
|
|
|
rm -rf config-tmp
|
|
|
|
mkdir config-tmp
|
|
|
|
run_cap_test env TMPDIR=config-tmp ${lnav_test} -n \
|
2021-02-01 09:43:19 +03:00
|
|
|
-c ':config /tuning/archive-manager/min-free-space abc' \
|
|
|
|
${srcdir}/logfile_syslog.0
|
|
|
|
|
2022-04-30 23:05:42 +03:00
|
|
|
# config bad theme
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2019-05-03 23:50:19 +03:00
|
|
|
-c ":config /ui/theme baddy" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 23:05:42 +03:00
|
|
|
# config bad theme
|
2022-09-12 17:18:26 +03:00
|
|
|
run_cap_test ${lnav_test} -W -n \
|
2019-05-03 23:50:19 +03:00
|
|
|
-I ${test_dir}/bad-config2 \
|
|
|
|
${test_dir}/logfile_access_log.0
|
2022-06-29 08:23:56 +03:00
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -nN \
|
|
|
|
-c ":reset-config /bad/path"
|
2023-07-16 07:50:46 +03:00
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -n -I ${test_dir} \
|
|
|
|
hw://seattle/finn
|