Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Willemt Raft
Commits
95aba85e
Commit
95aba85e
authored
Jan 13, 2014
by
willem
Browse files
Re-arranged source files
parent
9e8bb9f0
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
95aba85e
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)
raft_log.c
View file @
95aba85e
This diff is collapsed.
Click to expand it.
raft_node.c
View file @
95aba85e
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* found in the LICENSE file.
* found in the LICENSE file.
*
*
* @file
* @file
* @brief
Implem
entation of a
Raft serv
er
* @brief
Repres
entation of a
pe
er
* @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
;
}
}
...
...
test/CuTest.c
→
test
s
/CuTest.c
View file @
95aba85e
File moved
test/CuTest.h
→
test
s
/CuTest.h
View file @
95aba85e
File moved
make-tests.sh
→
tests/
make-tests.sh
View file @
95aba85e
File moved
test/mock_send_functions.c
→
test
s
/mock_send_functions.c
View file @
95aba85e
File moved
test/mock_send_functions.h
→
test
s
/mock_send_functions.h
View file @
95aba85e
File moved
test/test_log.c
→
test
s
/test_log.c
View file @
95aba85e
File moved
test/test_node.c
→
test
s
/test_node.c
View file @
95aba85e
File moved
test/test_scenario.c
→
test
s
/test_scenario.c
View file @
95aba85e
File moved
test/test_server.c
→
test
s
/test_server.c
View file @
95aba85e
File moved
test/test_server_request_vote.c
→
test
s
/test_server_request_vote.c
View file @
95aba85e
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment