]> granicus.if.org Git - esp-idf/commitdiff
ci: check that build uses ccache when present
authorRenz Christian Bagaporo <renz@espressif.com>
Mon, 6 May 2019 11:58:06 +0000 (19:58 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Tue, 4 Jun 2019 15:28:02 +0000 (23:28 +0800)
tools/ci/test_build_system_cmake.sh

index 1c0b0b3e3465d1c44fce62ab401a8cec5c944c7e..2740d6448840b4df956e4c8ebcbfb189b1859de8 100755 (executable)
@@ -372,6 +372,13 @@ EOF
     grep "$PWD/components/bootloader/subproject/main/bootloader_start.c" build/bootloader/compile_commands.json \
         || failure "Custom bootloader source files should be built instead of the original's"
     rm -rf components
+    
+    print_status "Check ccache is used to build when present"
+    touch ccache && chmod +x ccache  # make sure that ccache is present for this test
+    (export PATH=$PWD:$PATH && idf.py reconfigure | grep "ccache will be used for faster builds") || failure "ccache should be used when present"
+    (export PATH=$PWD:$PATH && idf.py reconfigure --no-ccache | grep -c "ccache will be used for faster builds" | grep -wq 0) \
+        || failure "ccache should not be used even when present if --no-ccache is specified"
+    rm -f ccache
 
     print_status "All tests completed"
     if [ -n "${FAILURES}" ]; then