Commit cd54e379 authored by Li Wei's avatar Li Wei
Browse files

DAOS-1406 build: Regenerate tests_main.c properly



Makefile target $(TEST_DIR)/main_test.c should depend on
$(TEST_DIR)/test_*.c. Otherwise, when a new test is added to test_log.c,
for instance, main_test.c won't be regenerated to include the new test.
Signed-off-by: default avatarLi Wei <wei.g.li@intel.com>
parent 74836ffa
...@@ -38,7 +38,7 @@ clinkedlistqueue: ...@@ -38,7 +38,7 @@ clinkedlistqueue:
download-contrib: clinkedlistqueue download-contrib: clinkedlistqueue
$(TEST_DIR)/main_test.c: $(TEST_DIR)/main_test.c: $(TEST_DIR)/test_*.c
if test -d $(LLQUEUE_DIR); \ if test -d $(LLQUEUE_DIR); \
then echo have contribs; \ then echo have contribs; \
else make download-contrib; \ else make download-contrib; \
...@@ -54,7 +54,7 @@ static: $(OBJECTS) ...@@ -54,7 +54,7 @@ static: $(OBJECTS)
ar -r libraft.a $(OBJECTS) ar -r libraft.a $(OBJECTS)
.PHONY: tests .PHONY: tests
tests: src/raft_server.c src/raft_server_properties.c src/raft_log.c src/raft_node.c $(TEST_DIR)/main_test.c $(TEST_DIR)/test_server.c $(TEST_DIR)/test_node.c $(TEST_DIR)/test_log.c $(TEST_DIR)/test_snapshotting.c $(TEST_DIR)/test_scenario.c $(TEST_DIR)/mock_send_functions.c $(TEST_DIR)/CuTest.c $(LLQUEUE_DIR)/linked_list_queue.c tests: src/raft_server.c src/raft_server_properties.c src/raft_log.c src/raft_node.c $(TEST_DIR)/main_test.c $(TEST_DIR)/test_*.c $(TEST_DIR)/mock_send_functions.c $(TEST_DIR)/CuTest.c $(LLQUEUE_DIR)/linked_list_queue.c
$(CC) $(CFLAGS) -o tests_main $^ $(CC) $(CFLAGS) -o tests_main $^
./tests_main ./tests_main
gcov raft_server.c gcov raft_server.c
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment