Skip to content

Commit

Permalink
Protect autologfixture with preprocessor
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Aug 23, 2022
1 parent 5d576ba commit 341a94b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions testing/include/gz/common/testing/AutoLogFixture.hh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Open Source Robotics Foundation
* Copyright (C) 2022 Open Source Robotics FoundationO
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,8 @@
#ifndef GZ_COMMON_TESTING_AUTOLOGFIXTURE_HH_
#define GZ_COMMON_TESTING_AUTOLOGFIXTURE_HH_

#include <gtest/gtest.h>
/// Protect to guarantee that gtest is included before this header.
#ifdef GTEST_API_

#include <memory>
#include <string>
Expand Down Expand Up @@ -56,4 +57,8 @@ class AutoLogFixture : public ::testing::Test

#include <gz/common/testing/detail/AutoLogFixture.hh>

#else
#warning "AutoLogFixture needs <gtest/gtest.h> to be included in order to work"
#endif // GTEST_API_

#endif // GZ_COMMON_TESTING_AUTOLOGFIXTURE_HH_

0 comments on commit 341a94b

Please sign in to comment.