Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TestSupport.hxx File Reference
#include "TError.h"
#include "TInterpreter.h"
#include <iostream>
#include <stdexcept>
#include <vector>

Classes

class  ROOT::TestSupport::CheckDiagsRAII
 Install a ROOT diagnostic handler to analyse diagnostics. More...
struct  ROOT::TestSupport::CheckDiagsRAII::Diag_t
class  ROOT::TestSupport::FileRaii
 An RAII wrapper around an open temporary file on disk. More...
class  ROOT::TestSupport::FilterDiagsRAII
 Allows a user function to catch and filter/analyse ROOT and cling diagnostics, e.g. More...

Namespaces

namespace  ROOT
namespace  ROOT::TestSupport

Macros

#define ROOT_EXPECT_DIAG(diag_class, expression, where, expected_diag, match_full)
#define ROOT_EXPECT_ERROR(expression, where, expected_diag)
#define ROOT_EXPECT_ERROR_PARTIAL(expression, where, expected_diag)
#define ROOT_EXPECT_INFO(expression, where, expected_diag)
#define ROOT_EXPECT_INFO_PARTIAL(expression, where, expected_diag)
#define ROOT_EXPECT_NODIAG(expression)
#define ROOT_EXPECT_SYSERROR(expression, where, expected_diag)
#define ROOT_EXPECT_SYSERROR_PARTIAL(expression, where, expected_diag)
#define ROOT_EXPECT_WARNING(expression, where, expected_diag)
#define ROOT_EXPECT_WARNING_PARTIAL(expression, where, expected_diag)

Detailed Description

The file contains facilities allowing easier writing of in-tree unit tests.

Author
Pratyush Das reikd.nosp@m.as@g.nosp@m.mail..nosp@m.com
Vassil Vassilev vvasi.nosp@m.lev@.nosp@m.cern..nosp@m.ch
Stephan Hageboeck steph.nosp@m.an.h.nosp@m.agebo.nosp@m.eck@.nosp@m.cern..nosp@m.ch
Date
April, 2020

Definition in file TestSupport.hxx.

Macro Definition Documentation

◆ ROOT_EXPECT_DIAG

#define ROOT_EXPECT_DIAG ( diag_class,
expression,
where,
expected_diag,
match_full )
Value:
{ \
using namespace ROOT::TestSupport; \
CheckDiagsRAII EE(diag_class, where, expected_diag, match_full); \
expression; \
}
Install a ROOT diagnostic handler to analyse diagnostics.

Definition at line 185 of file TestSupport.hxx.

◆ ROOT_EXPECT_ERROR

#define ROOT_EXPECT_ERROR ( expression,
where,
expected_diag )
Value:
ROOT_EXPECT_DIAG(kError, expression, where, expected_diag, true)
constexpr Int_t kError
Definition TError.h:47
#define ROOT_EXPECT_DIAG(diag_class, expression, where, expected_diag, match_full)

Definition at line 199 of file TestSupport.hxx.

◆ ROOT_EXPECT_ERROR_PARTIAL

#define ROOT_EXPECT_ERROR_PARTIAL ( expression,
where,
expected_diag )
Value:
ROOT_EXPECT_DIAG(kError, expression, where, expected_diag, false)

Definition at line 202 of file TestSupport.hxx.

◆ ROOT_EXPECT_INFO

#define ROOT_EXPECT_INFO ( expression,
where,
expected_diag )
Value:
ROOT_EXPECT_DIAG(kInfo, expression, where, expected_diag, true)
constexpr Int_t kInfo
Definition TError.h:45

Definition at line 211 of file TestSupport.hxx.

◆ ROOT_EXPECT_INFO_PARTIAL

#define ROOT_EXPECT_INFO_PARTIAL ( expression,
where,
expected_diag )
Value:
ROOT_EXPECT_DIAG(kInfo, expression, where, expected_diag, false)

Definition at line 214 of file TestSupport.hxx.

◆ ROOT_EXPECT_NODIAG

#define ROOT_EXPECT_NODIAG ( expression)
Value:
{ \
using namespace ROOT::TestSupport; \
expression; \
}

Definition at line 192 of file TestSupport.hxx.

◆ ROOT_EXPECT_SYSERROR

#define ROOT_EXPECT_SYSERROR ( expression,
where,
expected_diag )
Value:
ROOT_EXPECT_DIAG(kSysError, expression, where, expected_diag, true)
constexpr Int_t kSysError
Definition TError.h:49

Definition at line 217 of file TestSupport.hxx.

◆ ROOT_EXPECT_SYSERROR_PARTIAL

#define ROOT_EXPECT_SYSERROR_PARTIAL ( expression,
where,
expected_diag )
Value:
ROOT_EXPECT_DIAG(kSysError, expression, where, expected_diag, false)

Definition at line 220 of file TestSupport.hxx.

◆ ROOT_EXPECT_WARNING

#define ROOT_EXPECT_WARNING ( expression,
where,
expected_diag )
Value:
ROOT_EXPECT_DIAG(kWarning, expression, where, expected_diag, true)
constexpr Int_t kWarning
Definition TError.h:46

Definition at line 205 of file TestSupport.hxx.

◆ ROOT_EXPECT_WARNING_PARTIAL

#define ROOT_EXPECT_WARNING_PARTIAL ( expression,
where,
expected_diag )
Value:
ROOT_EXPECT_DIAG(kWarning, expression, where, expected_diag, false)

Definition at line 208 of file TestSupport.hxx.