travis: enable code coverage reporting. (#516)

This commit is contained in:
Jonathan Hui
2016-09-08 14:14:25 -07:00
committed by GitHub
parent 7c2b818d2e
commit 563685e187
13 changed files with 50 additions and 5 deletions
+4
View File
@@ -0,0 +1,4 @@
coverage:
ignore:
- "tests/*"
- "third_party/*"
+3
View File
@@ -37,6 +37,9 @@ before_install:
script:
- .travis/script.sh
after_success:
- bash <(curl -s https://codecov.io/bash)
matrix:
include:
- env: BUILD_TARGET="pretty-check"
+1 -1
View File
@@ -63,7 +63,7 @@ set -x
}
[ $BUILD_TARGET != posix-32-bit ] || {
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 BuildJobs=10 make -f examples/Makefile-posix check || die
COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 BuildJobs=10 make -f examples/Makefile-posix check || die
}
[ $BUILD_TARGET != posix-ncp ] || {
+3 -1
View File
@@ -1,5 +1,6 @@
[![OpenThread][ot-logo]][ot-repo]
[![Build Status][ot-travis-svg]][ot-travis]
[![Coverage Status][ot-codecov-svg]][ot-codecov]
---
@@ -18,7 +19,8 @@ applications. More information about Thread can be found on
[ot-logo]: doc/images/openthread_logo.png
[ot-travis]: https://travis-ci.org/openthread/openthread
[ot-travis-svg]: https://travis-ci.org/openthread/openthread.svg?branch=master
[ot-codecov]: https://codecov.io/gh/openthread/openthread
[ot-codecov-svg]: https://codecov.io/gh/openthread/openthread/branch/master/graph/badge.svg
## Features ##
+4
View File
@@ -73,4 +73,8 @@ ot_cli_SOURCES = \
main.c \
$(NULL)
if OPENTHREAD_BUILD_COVERAGE
CLEANFILES = $(wildcard *.gcda *.gcno)
endif # OPENTHREAD_BUILD_COVERAGE
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
+4
View File
@@ -73,4 +73,8 @@ ot_ncp_SOURCES = \
main.c \
$(NULL)
if OPENTHREAD_BUILD_COVERAGE
CLEANFILES = $(wildcard *.gcda *.gcno)
endif # OPENTHREAD_BUILD_COVERAGE
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
+12
View File
@@ -76,6 +76,9 @@ const struct Command Interpreter::sCommands[] =
#endif
{ "discover", &ProcessDiscover },
{ "eidcache", &ProcessEidCache },
#ifdef OPENTHREAD_EXAMPLES_POSIX
{ "exit", &ProcessExit },
#endif
{ "extaddr", &ProcessExtAddress },
{ "extpanid", &ProcessExtPanId },
{ "ifconfig", &ProcessIfconfig },
@@ -568,6 +571,15 @@ exit:
AppendResult(error);
}
#ifdef OPENTHREAD_EXAMPLES_POSIX
void Interpreter::ProcessExit(int argc, char *argv[])
{
exit(0);
(void)argc;
(void)argv;
}
#endif
void Interpreter::ProcessExtPanId(int argc, char *argv[])
{
ThreadError error = kThreadError_None;
+3
View File
@@ -147,6 +147,9 @@ private:
#endif // OPENTHREAD_ENABLE_DIAG
static void ProcessDiscover(int argc, char *argv[]);
static void ProcessEidCache(int argc, char *argv[]);
#ifdef OPENTHREAD_EXAMPLES_POSIX
static void ProcessExit(int argc, char *argv[]);
#endif
static void ProcessExtAddress(int argc, char *argv[]);
static void ProcessExtPanId(int argc, char *argv[]);
static void ProcessIfconfig(int argc, char *argv[]);
+2 -1
View File
@@ -160,7 +160,8 @@ noinst_HEADERS = \
$(NULL)
if OPENTHREAD_BUILD_COVERAGE
CLEANFILES = $(wildcard *.gcda *.gcno)
Dash = -
CLEANFILES = $(shell find $(top_builddir)/src/core $(Dash)name "*.gcda" $(Dash)o $(Dash)name "*.gcno")
endif # OPENTHREAD_BUILD_COVERAGE
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
+4 -1
View File
@@ -98,7 +98,10 @@ class Node:
def __del__(self):
if self.pexpect.isalive():
if self.node_type == 'ncp-sim':
if self.node_type == 'sim':
self.send_command('exit')
self.pexpect.expect('Done')
elif self.node_type == 'ncp-sim':
self.pexpect.sendcontrol('c');
self.pexpect.terminate()
self.pexpect.close(force=True)
+4
View File
@@ -142,6 +142,10 @@ test_diag_LDADD = $(top_builddir)/src/diag/libopenthread-diag.a
test_diag_SOURCES = test_diag.cpp
endif
if OPENTHREAD_BUILD_COVERAGE
CLEANFILES = $(wildcard *.gcda *.gcno)
endif # OPENTHREAD_BUILD_COVERAGE
endif # OPENTHREAD_BUILD_TESTS
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
+2 -1
View File
@@ -73,7 +73,8 @@ libmbedcrypto_a_SOURCES += \
endif # OPENTHREAD_ENABLE_DTLS
if OPENTHREAD_BUILD_COVERAGE
CLEANFILES = $(wildcard *.gcda *.gcno)
Dash = -
CLEANFILES = $(shell find $(top_builddir)/third_party/mbedtls $(Dash)name "*.gcda" $(Dash)o $(Dash)name "*.gcno")
endif # OPENTHREAD_BUILD_COVERAGE
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
+4
View File
@@ -47,4 +47,8 @@ spi_hdlc_adapter_SOURCES = \
spi-hdlc-adapter.c \
$(NULL)
if OPENTHREAD_BUILD_COVERAGE
CLEANFILES = $(wildcard *.gcda *.gcno)
endif # OPENTHREAD_BUILD_COVERAGE
include $(abs_top_nlbuild_autotools_dir)/automake/post.am