-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce CATCH_CONFIG_PREFIX_MESSAGES to only prefix a few logging r…
…elated macros. (#2544) * Add missing include for VxWorks build. std::min is defined in algorithm provides std::min. It appears to be transitively included for most platforms. For VxWorks however this explicit include is required. * Add option CATCH_CONFIG_PREFIX_MESSAGES to selectively prefix message macros only. In contrast to CATCH_CONFIG_PREFIX_ALL, this will only prefix the following macros: I.e. INFO, UNSCOPED_INFO, WARN and CATCH_CAPTURE This is mainly useful for codebases that use INFO or WARN for their own logging macros.
- Loading branch information
Showing
7 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ set(_OtherConfigOptions | |
"FAST_COMPILE" | ||
"NOSTDOUT" | ||
"PREFIX_ALL" | ||
"PREFIX_MESSAGES" | ||
"WINDOWS_CRTDBG" | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
// Copyright Catch2 Authors | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE.txt or copy at | ||
// https://www.boost.org/LICENSE_1_0.txt) | ||
|
||
// SPDX-License-Identifier: BSL-1.0 | ||
|
||
/** \file | ||
* Wrapper for the CATCH_CONFIG_PREFIX_MESSAGES configuration option | ||
* | ||
* CATCH_CONFIG_PREFIX_ALL can be used to avoid clashes with other macros | ||
* by prepending CATCH_. This may not be desirable if the only clashes are with | ||
* logger macros such as INFO and WARN. In this cases | ||
* CATCH_CONFIG_PREFIX_MESSAGES can be used to only prefix a small subset | ||
* of relevant macros. | ||
* | ||
*/ | ||
|
||
#ifndef CATCH_CONFIG_PREFIX_MESSAGES_HPP_INCLUDED | ||
#define CATCH_CONFIG_PREFIX_MESSAGES_HPP_INCLUDED | ||
|
||
#include <catch2/catch_user_config.hpp> | ||
|
||
#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_PREFIX_MESSAGES) | ||
#define CATCH_CONFIG_PREFIX_MESSAGES | ||
#endif | ||
|
||
#endif // CATCH_CONFIG_PREFIX_MESSAGES_HPP_INCLUDED |