Commit 95aba85e authored by willem's avatar willem
Browse files

Re-arranged source files

parent 9e8bb9f0
CONTRIB_DIR = .. CONTRIB_DIR = .
TEST_DIR = ./tests
LLQUEUE_DIR = $(CONTRIB_DIR)/CLinkedListQueue LLQUEUE_DIR = $(CONTRIB_DIR)/CLinkedListQueue
GCOV_OUTPUT = *.gcda *.gcno *.gcov GCOV_OUTPUT = *.gcda *.gcno *.gcov
GCOV_CCFLAGS = -fprofile-arcs -ftest-coverage GCOV_CCFLAGS = -fprofile-arcs -ftest-coverage
SHELL = /bin/bash SHELL = /bin/bash
CC = gcc CC = gcc
CCFLAGS = -g -O2 -Werror -Werror=return-type -Werror=uninitialized -Wcast-align -fno-omit-frame-pointer -fno-common -fsigned-char $(GCOV_CCFLAGS) -I$(LLQUEUE_DIR) CCFLAGS = -g -O2 -Werror -Werror=return-type -Werror=uninitialized -Wcast-align -fno-omit-frame-pointer -fno-common -fsigned-char $(GCOV_CCFLAGS) -I$(LLQUEUE_DIR) -I.
all: tests_main all: tests_main
...@@ -16,16 +17,16 @@ clinkedlistqueue: ...@@ -16,16 +17,16 @@ clinkedlistqueue:
download-contrib: clinkedlistqueue download-contrib: clinkedlistqueue
main_test.c: $(TEST_DIR)/main_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; \
fi fi
sh make-tests.sh "test_*.c" > main_test.c cd $(TEST_DIR) && sh make-tests.sh "test_*.c" > main_test.c && cd ..
tests_main: main_test.c raft_server.c raft_log.c raft_node.c test_server.c test_server_request_vote.c test_node.c test_log.c test_scenario.c mock_send_functions.c CuTest.c $(LLQUEUE_DIR)/linked_list_queue.c tests_main: raft_server.c raft_log.c raft_node.c $(TEST_DIR)/main_test.c $(TEST_DIR)/test_server.c $(TEST_DIR)/test_server_request_vote.c $(TEST_DIR)/test_node.c $(TEST_DIR)/test_log.c $(TEST_DIR)/test_scenario.c $(TEST_DIR)/mock_send_functions.c $(TEST_DIR)/CuTest.c $(LLQUEUE_DIR)/linked_list_queue.c
$(CC) $(CCFLAGS) -o $@ $^ $(CC) $(CCFLAGS) -o $@ $^
./tests_main ./tests_main
clean: clean:
rm -f main_test.c *.o $(GCOV_OUTPUT) rm -f $(TEST_DIR)/main_test.c *.o $(GCOV_OUTPUT)
This diff is collapsed.
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* found in the LICENSE file. * found in the LICENSE file.
* *
* @file * @file
* @brief Implementation of a Raft server * @brief Representation of a peer
* @author Willem Thiart himself@willemthiart.com * @author Willem Thiart himself@willemthiart.com
* @version 0.1 * @version 0.1
*/ */
...@@ -32,6 +32,7 @@ raft_node_t* raft_node_new(void* udata) ...@@ -32,6 +32,7 @@ raft_node_t* raft_node_new(void* udata)
int raft_node_is_leader(raft_node_t* me_) int raft_node_is_leader(raft_node_t* me_)
{ {
// TODO
return 0; return 0;
} }
......
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