Makefile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. TEST_PROGRAM=test_nvs
  2. all: $(TEST_PROGRAM)
  3. SOURCE_FILES = \
  4. esp_error_check_stub.cpp \
  5. $(addprefix ../src/, \
  6. nvs_types.cpp \
  7. nvs_api.cpp \
  8. nvs_page.cpp \
  9. nvs_pagemanager.cpp \
  10. nvs_storage.cpp \
  11. nvs_item_hash_list.cpp \
  12. nvs_encr.cpp \
  13. nvs_ops.cpp \
  14. nvs_handle_simple.cpp \
  15. nvs_handle_locked.cpp \
  16. nvs_partition_manager.cpp \
  17. nvs_cxx_api.cpp \
  18. ) \
  19. spi_flash_emulation.cpp \
  20. test_compressed_enum_table.cpp \
  21. test_spi_flash_emulation.cpp \
  22. test_intrusive_list.cpp \
  23. test_nvs.cpp \
  24. test_partition_manager.cpp \
  25. test_nvs_handle.cpp \
  26. test_nvs_storage.cpp \
  27. test_nvs_cxx_api.cpp \
  28. test_nvs_initialization.cpp \
  29. crc.cpp \
  30. main.cpp
  31. CPPFLAGS += -I../include -I../src -I./ -I../../esp_common/include -I../../esp32/include -I ../../mbedtls/mbedtls/include -I ../../spi_flash/include -I ../../soc/include -I ../../xtensa/include -I ../../../tools/catch -fprofile-arcs -ftest-coverage
  32. CFLAGS += -fprofile-arcs -ftest-coverage
  33. CXXFLAGS += -std=c++11 -Wall -Werror
  34. LDFLAGS += -lstdc++ -Wall -fprofile-arcs -ftest-coverage
  35. OBJ_FILES = $(SOURCE_FILES:.cpp=.o)
  36. COVERAGE_FILES = $(OBJ_FILES:.o=.gc*)
  37. $(OBJ_FILES): %.o: %.cpp
  38. $(TEST_PROGRAM): $(OBJ_FILES)
  39. $(MAKE) -C ../../mbedtls/mbedtls/ lib
  40. g++ $(LDFLAGS) -o $(TEST_PROGRAM) $(OBJ_FILES) ../../mbedtls/mbedtls/library/libmbedcrypto.a
  41. $(OUTPUT_DIR):
  42. mkdir -p $(OUTPUT_DIR)
  43. test: $(TEST_PROGRAM)
  44. ./$(TEST_PROGRAM) -d yes exclude:[long]
  45. long-test: $(TEST_PROGRAM)
  46. ./$(TEST_PROGRAM) -d yes
  47. $(COVERAGE_FILES): $(TEST_PROGRAM) long-test
  48. coverage.info: $(COVERAGE_FILES)
  49. find ../src/ -name "*.gcno" -exec gcov -r -pb {} +
  50. lcov --capture --directory ../src --no-external --output-file coverage.info
  51. coverage_report: coverage.info
  52. genhtml coverage.info --output-directory coverage_report
  53. @echo "Coverage report is in coverage_report/index.html"
  54. clean:
  55. $(MAKE) -C ../../mbedtls/mbedtls/ clean
  56. rm -f $(OBJ_FILES) $(TEST_PROGRAM)
  57. rm -f $(COVERAGE_FILES) *.gcov
  58. rm -rf coverage_report/
  59. rm -f coverage.info
  60. rm -f ../nvs_partition_generator/partition_single_page.bin
  61. rm -f ../nvs_partition_generator/partition_multipage_blob.bin
  62. rm -f ../nvs_partition_generator/partition_encrypted.bin
  63. rm -f ../nvs_partition_generator/partition_encrypted_using_keygen.bin
  64. rm -f ../nvs_partition_generator/partition_encrypted_using_keyfile.bin
  65. rm -f ../nvs_partition_generator/Test-1-partition-encrypted.bin
  66. rm -f ../nvs_partition_generator/Test-1-partition.bin
  67. rm -f ../../../tools/mass_mfg/samples/sample_values_multipage_blob_created.csv
  68. rm -f ../../../tools/mass_mfg/samples/sample_values_singlepage_blob_created.csv
  69. .PHONY: clean all test long-test