Commit f37ddb80 authored by incardon's avatar incardon

Changes to add covering test report

parent ca9460b4
......@@ -25,6 +25,26 @@ AC_PROG_CXX
AC_CANONICAL_HOST
###### Check for test coverage
AC_MSG_CHECKING(whether to build with test coverage)
test_cov=no
AC_ARG_ENABLE(test-coverage,
AC_HELP_STRING(
[--enable-test-coverage],
[enable test coverage]
),
test_cov="$enableval"
)
AC_MSG_RESULT($test_cov)
if test x"$test_cov" = x"yes"; then
AC_DEFINE([TEST_COVERAGE_MODE],[],[Test coverage mode])
CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage "
fi
###### Check for debug compilation
AC_MSG_CHECKING(whether to build with debug information)
......@@ -135,6 +155,11 @@ if [ test x"$memcheck" = x"yes" ]; then
else
echo "* memcheck: no *"
fi
if [ test x"$test_cov" = x"yes" ]; then
echo "* test coverage: yes *"
else
echo "* test coverage: no *"
fi
if [ test x"$debuger" = x"yes" ]; then
echo "* debug: yes *"
else
......
......@@ -8,10 +8,15 @@
#ifndef GRAPH_UNIT_TEST_HPP_
#define GRAPH_UNIT_TEST_HPP_
#include "config.h"
#include "map_graph.hpp"
#include "Point_test.hpp"
#ifdef TEST_COVERAGE_MODE
#define GS_SIZE 8
#else
#define GS_SIZE 128
#endif
BOOST_AUTO_TEST_SUITE( graph_test )
......
......@@ -1051,7 +1051,7 @@ public:
template<typename T> grid_key_dx_iterator_sub(const grid_sm<dim,T> & g, const grid_key_dx<dim> & start, const grid_key_dx<dim> & stop)
: grid_key_dx_iterator<dim>(g),grid_base(g),gk_start(start), gk_stop(stop)
{
#ifdef DEBUG
#if defined(DEBUG) && !defined(NO_WARNING)
//! If we are on debug check that the stop grid_key id bigger than the start
//! grid_key
......@@ -1059,7 +1059,7 @@ public:
{
if (gk_start.get(i) > gk_stop.get(i))
{
std::cerr << "Error grid_key_dx_iterator: " << __FILE__ << " " << __LINE__ << " the starting point of the grid cannot be bigger than the stop point at any coordinate" << "\n";
std::cerr << "Warning grid_key_dx_iterator: " << __FILE__ << " " << __LINE__ << " the starting point of the grid bigger than the stop point at any coordinate" << "\n";
}
}
#endif
......
......@@ -6,7 +6,11 @@
#include "Space/Shape/HyperCube.hpp"
#include "timer.hpp"
#ifdef TEST_COVERAGE_MODE
#define GS_SIZE 8
#else
#define GS_SIZE 128
#endif
template<unsigned int dim, typename g> void test_layout_gridNd(g & c3, size_t sz);
template<unsigned int dim, typename g> void test_layout_gridObjNd(g & c3, size_t sz);
......@@ -599,9 +603,11 @@ BOOST_AUTO_TEST_CASE( grid_use)
sz.push_back(GS_SIZE);
// test the grid from dimensionality 1 to 8 with several size non multiple of two
// Dimension 8-1
// With test coverage reduce the test size
#ifndef TEST_COVERAGE_MODE
test_all_grid<8>(4);
test_all_grid<7>(8);
test_all_grid<6>(9);
......@@ -610,6 +616,12 @@ BOOST_AUTO_TEST_CASE( grid_use)
test_all_grid<3>(126);
test_all_grid<2>(1414);
test_all_grid<1>(2000000);
#else
test_all_grid<4>(4);
test_all_grid<3>(8);
test_all_grid<2>(16);
test_all_grid<1>(256);
#endif
// Test the 3d gpu grid with CudaMemory and HeapMemory with different size
......
......@@ -15,8 +15,15 @@
typedef Point_test<float> P;
//! [typedef point]
#ifdef TEST_COVERAGE_MODE
#define FIRST_PUSH 1000
#define SECOND_PUSH 1000
#else
#define FIRST_PUSH 1000000
#define SECOND_PUSH 1000000
#endif
std::vector<Point_orig<float>> allocate_stl()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment