Skip to content

Commit 8008dc4

Browse files
author
Tero Heinonen
committed
Merge pull request #5 from ARMmbed/thread_changes
Thread changes
2 parents 11461a7 + f7148c7 commit 8008dc4

File tree

77 files changed

+6786
-669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+6786
-669
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
*.a
22
*.lib
33
output
4+
lcov
5+
coverage
6+
.yotta.json
7+
build/
8+
yotta_modules/
9+
yotta_targets/
10+

.yotta_ignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
unittest/*
2+
test/*
3+
doxygen/*
4+

CoAP_Server_unit_test/CoAP_Server_unit_test_app.c

Lines changed: 0 additions & 31 deletions
This file was deleted.

Makefile

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,32 @@
2020
#
2121
SERVLIB_DIR := ../libService
2222
override CFLAGS += -I$(SERVLIB_DIR)/libService/
23-
#override CFLAGS += -I$(SERVLIB_DIR)/libService/platform/
23+
24+
NANOSTACK_DIR := ../nanostack
25+
override CFLAGS += -I$(NANOSTACK_DIR)/nanostack/
2426

2527
NSDLC_DIR := ../nsdl-c
2628
override CFLAGS += -I$(NSDLC_DIR)/nsdl-c
2729

2830
EVENTLOOP_DIR := ../event-loop
2931
override CFLAGS += -I$(EVENTLOOP_DIR)/nanostack-event-loop/
30-
#override CFLAGS += -I$(EVENTLOOP_DIR)/event-loop/
31-
32-
#override CFLAGS += -I../libService/libService/
33-
#override CFLAGS += -I../nsdl-c/nsdl-c/
34-
#override CFLAGS += -I../event-loop/nanostack-event-loop/
35-
36-
LIB = libcoap-service.a
37-
38-
SRCS := \
39-
source/coap_service.c \
40-
source/coap_server.c \
41-
coap-service-nanomesh/coap_server_impl.c \
42-
43-
override CFLAGS += -DVERSION='"$(VERSION)"'
44-
4532

33+
MBEDTLS_DIR := ../mbedtls
34+
override CFLAGS += -I$(MBEDTLS_DIR)/configs -I$(MBEDTLS_DIR) -DMBEDTLS_CONFIG_FILE='<config-thread.h>' -I$(MBEDTLS_DIR)/include
4635

4736
COAPSERVICE_DIR := ../coap-service
4837
override CFLAGS += -I$(COAPSERVICE_DIR)/coap-service/
4938
override CFLAGS += -I$(COAPSERVICE_DIR)/source/include/
5039

51-
#override CFLAGS += -Isource/coap-service/source/include/
52-
#override CFLAGS += -Icoap-service-nanomesh/include/
40+
LIB = libcoap-service.a
41+
42+
SRCS := \
43+
source/coap_connection_handler.c \
44+
source/coap_message_handler.c \
45+
source/coap_security_handler.c \
46+
source/coap_service_api.c \
5347

48+
override CFLAGS += -DVERSION='"$(VERSION)"'
5449

5550
include ../libService/toolchain_rules.mk
5651

Makefile.test

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#
2+
# Makefile.test for COAP service unit tests
3+
#
4+
5+
# List of subdirectories to build
6+
TEST_FOLDER := ./test/
7+
# List of unit test directories for libraries
8+
UNITTESTS := $(sort $(dir $(wildcard $(TEST_FOLDER)*/unittest/*)))
9+
TESTDIRS := $(UNITTESTS:%=build-%)
10+
CLEANTESTDIRS := $(UNITTESTS:%=clean-%)
11+
COVERAGEFILE := ./lcov/coverage.info
12+
13+
.PHONY: test
14+
test: $(TESTDIRS)
15+
@rm -rf ./lcov
16+
@rm -rf ./coverage
17+
@mkdir -p lcov
18+
@mkdir -p lcov/results
19+
@mkdir coverage
20+
@find ./test -name '*.xml' | xargs cp -t ./lcov/results/
21+
@rm -f lcov/index.xml
22+
@./xsl_script.sh
23+
@cp junit_xsl.xslt lcov/.
24+
@xsltproc -o lcov/testresults.html lcov/junit_xsl.xslt lcov/index.xml
25+
@rm -f lcov/junit_xsl.xslt
26+
@rm -f lcov/index.xml
27+
@find ./ -name '*.gcno' | xargs cp --backup=numbered -t ./coverage/
28+
@find ./ -name '*.gcda' | xargs cp --backup=numbered -t ./coverage/
29+
@gcovr --object-directory ./coverage --exclude-unreachable-branches -e '.*/builds/.*' -e '.*/test/.*' -e '.*/yotta_modules/.*' -e '.*/stub/.*' -x -o ./lcov/gcovr.xml
30+
@lcov -d test/. -c -o $(COVERAGEFILE)
31+
@lcov -q -r $(COVERAGEFILE) "/usr*" -o $(COVERAGEFILE)
32+
@lcov -q -r $(COVERAGEFILE) "/test*" -o $(COVERAGEFILE)
33+
@lcov -q -r $(COVERAGEFILE) "/mbed-client-libservice*" -o $(COVERAGEFILE)
34+
@lcov -q -r $(COVERAGEFILE) "/libService*" -o $(COVERAGEFILE)
35+
@genhtml -q $(COVERAGEFILE) --show-details --output-directory lcov/html
36+
@echo coap-service unit tests built
37+
38+
$(TESTDIRS):
39+
@make -C $(@:build-%=%)
40+
41+
$(CLEANDIRS):
42+
@make -C $(@:clean-%=%) clean
43+
44+
$(CLEANTESTDIRS):
45+
@make -C $(@:clean-%=%) clean
46+
47+
# Extend default clean rule
48+
clean: clean-extra
49+
50+
clean-extra: $(CLEANDIRS) \
51+
$(CLEANTESTDIRS)

coap-service-linux/coap_server_impl.c

Lines changed: 0 additions & 16 deletions
This file was deleted.

coap-service-mbed/coap_server_impl.c

Lines changed: 0 additions & 16 deletions
This file was deleted.

coap-service-nanomesh/coap_server_impl.c

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)