make: do not rely on git to reset the file

The approach works but creates an error using the tools.git
"make test" target.  It would be nicer to not operate on the
actual config.xml that is checked in, but that's something
for later as tests need more of their own path use (and tmp
directory).
This commit is contained in:
Franco Fichtner 2025-10-29 08:28:07 +01:00
parent d37ac68481
commit edc11581b7

View file

@ -362,15 +362,19 @@ migrate:
validate:
@${PLUGINCTL} -v
# XXX we should stop treating AclConfig dir as the test's actual /conf dir
TEST_NO_CLOBBER= ${TESTDIR}/app/models/OPNsense/ACL/AclConfig/config.xml
test:
.if exists(${TESTDIR})
@if [ "$$(${VERSIONBIN} -v)" != "${CORE_PKGVERSION}" ]; then \
echo "Installed version does not match, expected ${CORE_PKGVERSION}"; \
exit 1; \
fi
@cd ${TESTDIR} && phpunit || true; rm -rf ${TESTDIR}/.phpunit.result.cache \
@cd ${TESTDIR} && cp ${TEST_NO_CLOBBER} ${TEST_NO_CLOBBER}.save && \
phpunit || true; rm -rf ${TESTDIR}/.phpunit.result.cache \
${TESTDIR}/app/models/OPNsense/ACL/AclConfig/backup; \
${GIT} checkout -f ${TESTDIR}/app/models/OPNsense/ACL/AclConfig/config.xml
mv ${TEST_NO_CLOBBER}.save ${TEST_NO_CLOBBER}
.endif
clean: clean-pkgdir clean-wrksrc clean-mfcdir checkout