Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the new MSVC preprocessor #1734

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Release/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if (NOT (MSVC_VERSION LESS 1920))
add_compile_options(/permissive-)
endif()

if (NOT (MSVC_VERSION LESS 1926))
add_compile_options(/Zc:preprocessor)
endif()
endif()
else()
message("-- Unknown compiler, success is doubtful.")
Expand Down
4 changes: 2 additions & 2 deletions Release/tests/common/UnitTestpp/src/CheckMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
#error UnitTest++ redefines VERIFY_IS_NULL
#endif

#ifdef WIN32
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define VERIFY_IS_TRUE(expression, ...) CHECK_EQUAL(true, expression, __VA_ARGS__)
#define VERIFY_IS_FALSE(expression, ...) CHECK_EQUAL(false, expression, __VA_ARGS__)
#define VERIFY_ARE_NOT_EQUAL(expected, actual, ...) CHECK_NOT_EQUAL(expected, actual, __VA_ARGS__)
Expand All @@ -118,7 +118,7 @@
UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), #value); \
UNITTEST_MULTILINE_MACRO_END

#ifdef WIN32
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL

#define CHECK_EQUAL(expected, actual, ...) \
do \
Expand Down
8 changes: 4 additions & 4 deletions Release/tests/common/UnitTestpp/src/TestMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ extern "C" _DLL_EXPORT TestList& __cdecl GetTestList();
} \
namespace Suite##Name

#ifdef _WIN32
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define TEST_EX(Name, List, ...) \
class Test##Name : public UnitTest::Test \
{ \
Expand Down Expand Up @@ -124,13 +124,13 @@ extern "C" _DLL_EXPORT TestList& __cdecl GetTestList();
void Test##Name::RunImpl() const
#endif

#ifdef _WIN32
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define TEST(Name, ...) TEST_EX(Name, UnitTest::GetTestList(), __VA_ARGS__)
#else
#define TEST(Name, ...) TEST_EX(Name, UnitTest::GetTestList(), ##__VA_ARGS__)
#endif

#ifdef _WIN32
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define TEST_FIXTURE_EX(Fixture, Name, List, ...) \
class Fixture##Name##Helper : public Fixture \
{ \
Expand Down Expand Up @@ -242,7 +242,7 @@ extern "C" _DLL_EXPORT TestList& __cdecl GetTestList();
void Fixture##Name##Helper::RunImpl()
#endif

#ifdef _WIN32
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define TEST_FIXTURE(Fixture, Name, ...) TEST_FIXTURE_EX(Fixture, Name, UnitTest::GetTestList(), __VA_ARGS__)
#else
#define TEST_FIXTURE(Fixture, Name, ...) TEST_FIXTURE_EX(Fixture, Name, UnitTest::GetTestList(), ##__VA_ARGS__)
Expand Down