Skip to content

Commit

Permalink
Adds code coverage to automatic CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Vandeberg committed Dec 16, 2016
1 parent fe7084a commit e00d2d8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ else( WIN32 ) # Apple AND Linux
endif()
endif()

set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")

# based on http://www.delorie.com/gnu/docs/gdb/gdb_70.html
# uncomment this line to tell GDB about macros (slows compile times)
# set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -gdwarf-2 -g3" )
Expand Down
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN \
pbzip2 \
python3 \
python3-dev \
lcov \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand All @@ -45,6 +46,30 @@ RUN \
programs/build_helpers/check_reflect.py && \
rm -rf /usr/local/src/steem/build

RUN \
cd /usr/local/src/steem && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_COVERAGE_TESTING=ON \
-DBUILD_STEEM_TESTNET=ON \
-DLOW_MEMORY_NODE=OFF \
-DCLEAR_VOTES=ON \
.. && \
make -j$(nproc) chain_test && \
cd .. && \
lcov --capture --initial --directory . --output-file build/base.info --no-external && \
./build/tests/chain_test && \
lcov --capture --directory . --output-file build/test.info --no-external && \
lcov --add-tracefile build/base.info --add-tracefile build/test.info --output-file build/total.info && \
lcov -o build/interesting.info -r build/total.info tests/\* &&\
mkdir -p /var/jenkins_home/lcov && \
genhtml build/interesting.info --output-directory /var/jenkins_home/lcov && \
cd /usr/local/src/steem && \
rm -rf /usr/local/src/steem/build

RUN \
cd /usr/local/src/steem && \
git submodule update --init --recursive && \
Expand Down Expand Up @@ -114,6 +139,7 @@ RUN \
python-dev \
python2.7-dev \
python3-dev \
lcov \
&& \
apt-get autoremove -y && \
rm -rf \
Expand Down
3 changes: 3 additions & 0 deletions tests/tests/operation_time_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2426,6 +2426,8 @@ BOOST_AUTO_TEST_CASE( comment_freeze )
FC_LOG_AND_RETHROW()
}

// This test is too intensive without optimizations. Disable it when we build in debug
#ifndef DEBUG
BOOST_AUTO_TEST_CASE( sbd_stability )
{
try
Expand Down Expand Up @@ -2568,6 +2570,7 @@ BOOST_AUTO_TEST_CASE( sbd_stability )
}
FC_LOG_AND_RETHROW()
}
#endif

BOOST_AUTO_TEST_CASE( sbd_price_feed_limit )
{
Expand Down

0 comments on commit e00d2d8

Please sign in to comment.