mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04: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:
parent
344e757a6a
commit
4a7ca68596
@ -205,6 +205,23 @@ function run_tests()
|
||||
git checkout main/component.mk
|
||||
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"
|
||||
if [ -n "${FAILURES}" ]; then
|
||||
echo "Some failures were detected:"
|
||||
|
Loading…
Reference in New Issue
Block a user