LLVM OpenMP 22.0.0git
OmptTester.h
Go to the documentation of this file.
1//===- OmptTester.h - Main header for ompTest usage -------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file represents the main header file for usage of the ompTest library.
11/// Depending on the build either 'standalone' or GoogleTest headers are
12/// included and corresponding main-function macros are defined.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef OPENMP_TOOLS_OMPTEST_INCLUDE_OMPTTESTER_H
17#define OPENMP_TOOLS_OMPTEST_INCLUDE_OMPTTESTER_H
18
19#include "AssertMacros.h"
20#include "Logging.h"
21#include "OmptAliases.h"
22#include "OmptAssertEvent.h"
23#include "OmptAsserter.h"
24#include "OmptCallbackHandler.h"
25
26#include <cassert>
27#include <iostream>
28#include <memory>
29#include <string>
30#include <thread>
31#include <unordered_set>
32#include <vector>
33
34// Standalone header section
35#ifdef OPENMP_LIBOMPTEST_BUILD_STANDALONE
36
38
39// Define standalone main function (place once at the bottom of a testsuite)
40#define OMPTEST_TESTSUITE_MAIN() \
41 int main(int argc, char **argv) { \
42 Runner R; \
43 return R.run(); \
44 }
45
46// GoogleTest header section
47#else
48
50
51// Define GoogleTest main function (place once at the bottom of a testsuite)
52#define OMPTEST_TESTSUITE_MAIN() \
53 int main(int argc, char **argv) { \
54 testing::InitGoogleTest(&argc, argv); \
55 return RUN_ALL_TESTS(); \
56 }
57
58#endif
59
60#endif
Provides macros to be used in unit tests for OMPT events.
Provides ompTest-tailored logging, with log-levels and formatting/coloring.
Defines shorthand aliases for OMPT enum values, providing improved ease-of-use and readability.
Contains assertion event constructors, for generally all observable events.
Contains all asserter-related class declarations and important enums.
This file provides the OMPT callback handling declarations.
This file represents the GoogleTest-based header variant, defining the actual test classes and their ...
This file represents the 'standalone' header variant, defining the actual test classes and their beha...