Compadre 1.6.8
Loading...
Searching...
No Matches
Compadre_UnitTests.cpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Compadre: COMpatible PArticle Discretization and REmap Toolkit
4//
5// Copyright 2018 NTESS and the Compadre contributors.
6// SPDX-License-Identifier: BSD-2-Clause
7// *****************************************************************************
8// @HEADER
9#include <gtest/gtest.h>
11#include "unittests/test_XYZ.hpp"
12#include "unittests/test_NeighborLists.hpp"
13#include "unittests/test_PointCloudSearch.hpp"
14#include "unittests/test_LinearAlgebra.hpp"
15#include "unittests/test_Targets.hpp"
16#ifdef COMPADRE_USE_MPI
17#include <mpi.h>
18#endif
19
20// this provides main(),
21// but all other tests come from ./unittests/*.cpp
22int main(int argc, char **argv) {
23
24 // initializes MPI (if available) with command line arguments given
25 #ifdef COMPADRE_USE_MPI
26 MPI_Init(&argc, &argv);
27 #endif
28 // this MPI init is rerun when using the "threadsafe" test style below
29
30 ::testing::InitGoogleTest(&argc, argv);
31
32 // initializes kokkos
33 Kokkos::initialize(argc, argv);
34
35 // execute all tests
36 ::testing::GTEST_FLAG(filter) = "*";
37 int sig = RUN_ALL_TESTS();
38
39 // finalize Kokkos and MPI (if available)
40 Kokkos::finalize();
41
42 // finialize MPI (if available)
43 #ifdef COMPADRE_USE_MPI
44 MPI_Finalize();
45 #endif
46 return sig;
47}
int main(int argc, char **argv)