2016-08-17 15:08:22 +00:00
|
|
|
TEST_PROGRAM=test_nvs
|
2016-08-22 06:16:21 +00:00
|
|
|
all: $(TEST_PROGRAM)
|
2016-08-17 15:08:22 +00:00
|
|
|
|
|
|
|
SOURCE_FILES = \
|
2017-03-02 06:22:22 +00:00
|
|
|
esp_error_check_stub.cpp \
|
2016-08-17 15:08:22 +00:00
|
|
|
$(addprefix ../src/, \
|
|
|
|
nvs_types.cpp \
|
|
|
|
nvs_api.cpp \
|
|
|
|
nvs_page.cpp \
|
|
|
|
nvs_pagemanager.cpp \
|
|
|
|
nvs_storage.cpp \
|
2016-09-20 14:40:12 +00:00
|
|
|
nvs_item_hash_list.cpp \
|
2016-08-17 15:08:22 +00:00
|
|
|
) \
|
|
|
|
spi_flash_emulation.cpp \
|
|
|
|
test_compressed_enum_table.cpp \
|
|
|
|
test_spi_flash_emulation.cpp \
|
|
|
|
test_intrusive_list.cpp \
|
|
|
|
test_nvs.cpp \
|
2016-08-22 06:16:21 +00:00
|
|
|
crc.cpp \
|
2016-08-17 15:08:22 +00:00
|
|
|
main.cpp
|
|
|
|
|
2017-04-10 13:31:27 +00:00
|
|
|
CPPFLAGS += -I../include -I../src -I./ -I../../esp32/include -I ../../spi_flash/include -I ../../../tools/catch -fprofile-arcs -ftest-coverage
|
2016-08-22 06:16:21 +00:00
|
|
|
CFLAGS += -fprofile-arcs -ftest-coverage
|
2016-08-17 15:08:22 +00:00
|
|
|
CXXFLAGS += -std=c++11 -Wall -Werror
|
2016-08-22 06:16:21 +00:00
|
|
|
LDFLAGS += -lstdc++ -Wall -fprofile-arcs -ftest-coverage
|
2016-08-17 15:08:22 +00:00
|
|
|
|
|
|
|
OBJ_FILES = $(SOURCE_FILES:.cpp=.o)
|
|
|
|
|
2016-08-22 06:16:21 +00:00
|
|
|
COVERAGE_FILES = $(OBJ_FILES:.o=.gc*)
|
|
|
|
|
2016-08-17 15:08:22 +00:00
|
|
|
$(OBJ_FILES): %.o: %.cpp
|
|
|
|
|
|
|
|
$(TEST_PROGRAM): $(OBJ_FILES)
|
2016-08-23 07:14:13 +00:00
|
|
|
g++ $(LDFLAGS) -o $(TEST_PROGRAM) $(OBJ_FILES)
|
2016-08-17 15:08:22 +00:00
|
|
|
|
|
|
|
$(OUTPUT_DIR):
|
|
|
|
mkdir -p $(OUTPUT_DIR)
|
|
|
|
|
|
|
|
test: $(TEST_PROGRAM)
|
2018-04-16 03:51:43 +00:00
|
|
|
./$(TEST_PROGRAM) -d yes exclude:[long]
|
2016-08-17 15:08:22 +00:00
|
|
|
|
2016-08-23 04:54:09 +00:00
|
|
|
long-test: $(TEST_PROGRAM)
|
2018-04-16 03:51:43 +00:00
|
|
|
./$(TEST_PROGRAM) -d yes
|
2016-08-23 04:54:09 +00:00
|
|
|
|
|
|
|
$(COVERAGE_FILES): $(TEST_PROGRAM) long-test
|
2016-08-22 06:16:21 +00:00
|
|
|
|
|
|
|
coverage.info: $(COVERAGE_FILES)
|
|
|
|
find ../src/ -name "*.gcno" -exec gcov -r -pb {} +
|
|
|
|
lcov --capture --directory ../src --no-external --output-file coverage.info
|
|
|
|
|
|
|
|
coverage_report: coverage.info
|
|
|
|
genhtml coverage.info --output-directory coverage_report
|
|
|
|
@echo "Coverage report is in coverage_report/index.html"
|
|
|
|
|
2016-08-17 15:08:22 +00:00
|
|
|
clean:
|
|
|
|
rm -f $(OBJ_FILES) $(TEST_PROGRAM)
|
2016-08-22 06:16:21 +00:00
|
|
|
rm -f $(COVERAGE_FILES) *.gcov
|
|
|
|
rm -rf coverage_report/
|
|
|
|
rm -f coverage.info
|
2016-08-17 15:08:22 +00:00
|
|
|
|
2018-04-16 03:51:43 +00:00
|
|
|
.PHONY: clean all test long-test
|