Newer
Older
Tomáš Oberhuber
committed
checkDownBoundary( *gridPtr, *dof, true, false, 8 );
checkRightBoundary( *gridPtr, *dof, true, false, -7 );
}
}

Vít Hanousek
committed
#else
TEST(NoMPI, NoTest)
{

Vít Hanousek
committed
ASSERT_TRUE(true) << ":-(";

Vít Hanousek
committed
}
#endif
#endif
#if (defined(HAVE_GTEST) && defined(HAVE_MPI))
#include <sstream>
Tomáš Oberhuber
committed
class MinimalistBufferedPrinter : public ::testing::EmptyTestEventListener {

Vít Hanousek
committed

Vít Hanousek
committed
private:

Vít Hanousek
committed
std::stringstream sout;

Vít Hanousek
committed
public:

Vít Hanousek
committed

Vít Hanousek
committed
// Called before a test starts.
virtual void OnTestStart(const ::testing::TestInfo& test_info) {
sout<< test_info.test_case_name() <<"." << test_info.name() << " Start." <<std::endl;
}
// Called after a failed assertion or a SUCCEED() invocation.
virtual void OnTestPartResult(
const ::testing::TestPartResult& test_part_result) {
sout << (test_part_result.failed() ? "====Failure=== " : "===Success=== ")

Vít Hanousek
committed
<< test_part_result.file_name() << " "

Vít Hanousek
committed
<< test_part_result.line_number() <<std::endl
<< test_part_result.summary() <<std::endl;
}
// Called after a test ends.
virtual void OnTestEnd(const ::testing::TestInfo& test_info)

Vít Hanousek
committed
{
int rank=CommunicatorType::GetRank(CommunicatorType::AllGroup);

Vít Hanousek
committed
sout<< test_info.test_case_name() <<"." << test_info.name() << " End." <<std::endl;

Vít Hanousek
committed
std::cout << rank << ":" << std::endl << sout.str()<< std::endl;
sout.str( std::string() );
sout.clear();

Vít Hanousek
committed
}
};
#endif
#include "../../src/UnitTests/GtestMissingError.h"
int main( int argc, char* argv[] )
{
#ifdef HAVE_GTEST
::testing::InitGoogleTest( &argc, argv );

Vít Hanousek
committed
#ifdef HAVE_MPI
::testing::TestEventListeners& listeners =
::testing::UnitTest::GetInstance()->listeners();

Vít Hanousek
committed

Vít Hanousek
committed
delete listeners.Release(listeners.default_result_printer());
Tomáš Oberhuber
committed
listeners.Append(new MinimalistBufferedPrinter);

Vít Hanousek
committed

Vít Hanousek
committed
#endif
int result= RUN_ALL_TESTS();

Vít Hanousek
committed

Vít Hanousek
committed
#ifdef HAVE_MPI

Vít Hanousek
committed
#endif
return result;

Vít Hanousek
committed
#else
throw GtestMissingError();
#endif
}