Browse Source

Coverage info

cl-refactor
Dimitry 10 years ago
parent
commit
402dc01640
  1. 7
      cmake/EthCompilerSettings.cmake
  2. 33
      getcoverage.sh
  3. 0
      test/libethereum/StateTestsFiller/stPreCompiledContractsTransactionFiller.json
  4. 4
      test/libethereum/state.cpp

7
cmake/EthCompilerSettings.cmake

@ -64,6 +64,13 @@ if (PROFILING AND (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_C
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lprofiler")
endif ()
if (PROFILING AND (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")))
set(CMAKE_CXX_FLAGS "-g --coverage ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-g --coverage ${CMAKE_C_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "--coverage ${CMAKE_SHARED_LINKER_FLAGS} -lprofiler")
set(CMAKE_EXE_LINKER_FLAGS "--coverage ${CMAKE_EXE_LINKER_FLAGS} -lprofiler")
endif ()
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
option(USE_LD_GOLD "Use GNU gold linker" ON)
if (USE_LD_GOLD)

33
getcoverage.sh

@ -0,0 +1,33 @@
#!/bin/bash
CPP_ETHEREUM_PATH=$(pwd)
if [ ! -d "$CPP_ETHEREUM_PATH/build/test" ]; then
echo "You need to compile and build ethereum with cmake -DPROFILING option to the build dir!"
exit;
fi
if which lcov >/dev/null; then
if which genhtml >/dev/null; then
echo Running testeth...
$($CPP_ETHEREUM_PATH/build/test/testeth)
echo Prepearing coverage info...
else
echo genhtml not found
exit;
fi
else
echo lcov not found
exit;
fi
OUTPUT_DIR="$CPP_ETHEREUM_PATH/build/test/coverage"
TESTETH=$CPP_ETHEREUM_PATH/build/test/CMakeFiles/testeth.dir
lcov --capture --directory $TESTETH --output-file $OUTPUT_DIR/coverage.info
genhtml $OUTPUT_DIR/coverage.info --output-directory $OUTPUT_DIR/testeth
echo "Coverage info should be located at: $CPP_ETHEREUM_PATH/build/test/coverage/testeth"
echo "Opening index..."
xdg-open $CPP_ETHEREUM_PATH/build/test/coverage/testeth/index.html

0
test/libethereum/StateTestsFiller/stPrecompiledContractsTransactionFiller.json → test/libethereum/StateTestsFiller/stPreCompiledContractsTransactionFiller.json

4
test/libethereum/state.cpp

@ -129,9 +129,9 @@ BOOST_AUTO_TEST_CASE(stPreCompiledContracts)
dev::test::executeTests("stPreCompiledContracts", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests);
}
BOOST_AUTO_TEST_CASE(stPrecompiledContractsTransaction)
BOOST_AUTO_TEST_CASE(stPreCompiledContractsTransaction)
{
dev::test::executeTests("stPrecompiledContractsTransaction", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests);
dev::test::executeTests("stPreCompiledContractsTransaction", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests);
}
BOOST_AUTO_TEST_CASE(stLogTests)

Loading…
Cancel
Save