Crashpad
Classes | Namespaces | Macros
gtest_disabled.h File Reference
#include <string>
#include <vector>
#include "base/macros.h"
#include "gtest/gtest.h"

Classes

class  crashpad::test::DisabledTestGtestEnvironment
 Provides support for dynamically disabled gtest tests. More...
 

Namespaces

 crashpad
 The main namespace.
 
 crashpad::test
 The testing namespace, for use in test code only.
 

Macros

#define DISABLED_TEST()
 Displays a message about a test being disabled, and returns early. More...
 

Macro Definition Documentation

◆ DISABLED_TEST

#define DISABLED_TEST ( )
Value:
do { \
return; \
} while (false)
void DisabledTest()
Displays a message about a test being disabled, and arranges for this information to be duplicated in...
Definition: gtest_disabled.cc:40
static DisabledTestGtestEnvironment * Get()
Returns the DisabledTestGtestEnvironment singleton instance, creating it if necessary.
Definition: gtest_disabled.cc:33

Displays a message about a test being disabled, and returns early.

gtest only provides a mechanism for tests to be disabled statically, by prefixing test case names or test names with DISABLED_. When it is necessary to disable tests dynamically, gtest provides no assistance. This macro displays a message about the disabled test and returns early. The dynamically disabled test will also be displayed during gtest global test environment tear-down before the test executable exits.

This macro may only be invoked from the context of a gtest test.

There’s a long-standing gtest feature request to provide this functionality directly in gtest, but since it hasn’t been implemented, this macro provides a local mechanism to achieve it.