tools: Add unit tests
This commit is contained in:
parent
187f9945bc
commit
3d1e064e1a
2 changed files with 22 additions and 0 deletions
|
@ -251,8 +251,19 @@ function run_tests()
|
||||||
make
|
make
|
||||||
assert_rebuilt ${APP_BINS}
|
assert_rebuilt ${APP_BINS}
|
||||||
assert_not_rebuilt ${BOOTLOADER_BINS} esp32/libesp32.a
|
assert_not_rebuilt ${BOOTLOADER_BINS} esp32/libesp32.a
|
||||||
|
|
||||||
|
print_status "Re-building does not change app.bin"
|
||||||
|
take_build_snapshot
|
||||||
|
make
|
||||||
|
assert_not_rebuilt ${APP_BINS} ${BOOTLOADER_BINS} esp32/libesp32.a
|
||||||
rm -f ${TESTDIR}/template/version.txt
|
rm -f ${TESTDIR}/template/version.txt
|
||||||
|
|
||||||
|
print_status "Get the version of app from git describe. Project is not inside IDF and do not have a tag only a hash commit."
|
||||||
|
make >> log.log || failure "Failed to build"
|
||||||
|
version="App \"app-template\" version: "
|
||||||
|
version+=$(git describe --always --tags --dirty)
|
||||||
|
grep "${version}" log.log || failure "Project version should have a hash commit"
|
||||||
|
|
||||||
print_status "Build fails if partitions don't fit in flash"
|
print_status "Build fails if partitions don't fit in flash"
|
||||||
sed -i.bak "s/CONFIG_ESPTOOLPY_FLASHSIZE.\+//" sdkconfig # remove all flashsize config
|
sed -i.bak "s/CONFIG_ESPTOOLPY_FLASHSIZE.\+//" sdkconfig # remove all flashsize config
|
||||||
echo "CONFIG_ESPTOOLPY_FLASHSIZE_1MB=y" >> sdkconfig # introduce undersize flash
|
echo "CONFIG_ESPTOOLPY_FLASHSIZE_1MB=y" >> sdkconfig # introduce undersize flash
|
||||||
|
|
|
@ -107,8 +107,19 @@ function run_tests()
|
||||||
idf.py build || failure "Failed to rebuild with changed app version"
|
idf.py build || failure "Failed to rebuild with changed app version"
|
||||||
assert_rebuilt ${APP_BINS}
|
assert_rebuilt ${APP_BINS}
|
||||||
assert_not_rebuilt ${BOOTLOADER_BINS} esp-idf/esp32/libesp32.a
|
assert_not_rebuilt ${BOOTLOADER_BINS} esp-idf/esp32/libesp32.a
|
||||||
|
|
||||||
|
print_status "Re-building does not change app.bin"
|
||||||
|
take_build_snapshot
|
||||||
|
idf.py build
|
||||||
|
assert_not_rebuilt ${APP_BINS} ${BOOTLOADER_BINS} esp-idf/esp32/libesp32.a
|
||||||
rm -f ${TESTDIR}/template/version.txt
|
rm -f ${TESTDIR}/template/version.txt
|
||||||
|
|
||||||
|
print_status "Get the version of app from git describe. Project is not inside IDF and do not have a tag only a hash commit."
|
||||||
|
idf.py build >> log.log || failure "Failed to build"
|
||||||
|
version="Project version: "
|
||||||
|
version+=$(git describe --always --tags --dirty)
|
||||||
|
grep "${version}" log.log || failure "Project version should have a hash commit"
|
||||||
|
|
||||||
print_status "Moving BUILD_DIR_BASE out of tree"
|
print_status "Moving BUILD_DIR_BASE out of tree"
|
||||||
clean_build_dir
|
clean_build_dir
|
||||||
OUTOFTREE_BUILD=${TESTDIR}/alt_build
|
OUTOFTREE_BUILD=${TESTDIR}/alt_build
|
||||||
|
|
Loading…
Reference in a new issue