2015-08-10 04:03:23 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
CONFIG_DIR="${top_builddir}/installer-test-home"
|
|
|
|
|
|
|
|
mkdir -p "${CONFIG_DIR}"
|
|
|
|
rm -rf "${CONFIG_DIR}/.lnav/formats"
|
|
|
|
|
|
|
|
HOME=${CONFIG_DIR}
|
2021-08-29 15:46:10 +00:00
|
|
|
unset XDG_CONFIG_HOME
|
2015-08-10 04:03:23 +00:00
|
|
|
export HOME
|
2024-03-06 17:17:53 +00:00
|
|
|
export YES_COLOR=1
|
2015-08-10 04:03:23 +00:00
|
|
|
|
|
|
|
${lnav_test} -i ${srcdir}/formats/jsontest/format.json
|
|
|
|
|
|
|
|
if ! test -f ${CONFIG_DIR}/.lnav/formats/installed/test_log.json; then
|
|
|
|
echo "Format not installed correctly?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-03-06 17:17:53 +00:00
|
|
|
run_cap_test ${lnav_test} -i ${srcdir}/formats/jsontest/format.json
|
|
|
|
|
|
|
|
echo corrupt > ${CONFIG_DIR}/.lnav/formats/installed/test_log.json
|
|
|
|
|
|
|
|
run_cap_test env TEST_COMMENT='overwrite file' ${lnav_test} -i ${srcdir}/formats/jsontest/format.json
|
|
|
|
|
|
|
|
if ! test -f ${CONFIG_DIR}/.lnav/formats/installed/test_log.json.bak; then
|
|
|
|
echo "Format not backed up correctly?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -i /non-existent/file
|
|
|
|
|
2015-08-10 04:03:23 +00:00
|
|
|
if test x"${TEST_GIT_INSTALL}" = x""; then
|
|
|
|
# Hitting the git repos frequently is slow/noisy
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
${lnav_test} -i extra
|
|
|
|
|
|
|
|
if ! test -f ${CONFIG_DIR}/.lnav/remote-config/remote-config.json; then
|
|
|
|
echo "Remote config not downloaded?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! test -d ${CONFIG_DIR}/.lnav/formats/https___github_com_PaulWay_lnav_formats_git; then
|
|
|
|
echo "Third-party repo not downloaded?"
|
|
|
|
exit 1
|
|
|
|
fi
|