mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 05:04:33 +02:00
tools/ci: add test case for build without dependency on git
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
This commit is contained in:
@@ -205,6 +205,23 @@ function run_tests()
|
|||||||
git checkout main/component.mk
|
git checkout main/component.mk
|
||||||
rm -rf extra_source_dir
|
rm -rf extra_source_dir
|
||||||
|
|
||||||
|
print_status "Can build without git installed on system"
|
||||||
|
clean_build_dir
|
||||||
|
# Make provision for getting IDF version
|
||||||
|
echo "custom-version-x.y" > ${IDF_PATH}/version.txt
|
||||||
|
# Hide .gitmodules so that submodule check is avoided
|
||||||
|
[ -f ${IDF_PATH}/.gitmodules ] && mv ${IDF_PATH}/.gitmodules ${IDF_PATH}/.gitmodules_backup
|
||||||
|
# Overload `git` command
|
||||||
|
echo -e '#!/bin/bash\ntouch ${IDF_PATH}/git_invoked' > git
|
||||||
|
chmod +x git
|
||||||
|
OLD_PATH=$PATH
|
||||||
|
export PATH="$PWD:$PATH"
|
||||||
|
make
|
||||||
|
[ -f ${IDF_PATH}/git_invoked ] && rm ${IDF_PATH}/git_invoked && failure "git should not have been invoked in this case"
|
||||||
|
rm -f ${IDF_PATH}/version.txt git
|
||||||
|
[ -f ${IDF_PATH}/.gitmodules_backup ] && mv ${IDF_PATH}/.gitmodules_backup ${IDF_PATH}/.gitmodules
|
||||||
|
export PATH=$OLD_PATH
|
||||||
|
|
||||||
print_status "All tests completed"
|
print_status "All tests completed"
|
||||||
if [ -n "${FAILURES}" ]; then
|
if [ -n "${FAILURES}" ]; then
|
||||||
echo "Some failures were detected:"
|
echo "Some failures were detected:"
|
||||||
|
Reference in New Issue
Block a user