Skip to content

Commit

Permalink
Unify MOZC_USE_MOZC_GOOGLETEST to MOZC_USE_MOZC_TESTING
Browse files Browse the repository at this point in the history
* There is no longer any differences today.

#codehealth

PiperOrigin-RevId: 602683004
  • Loading branch information
hiroyuki-komatsu committed Jan 30, 2024
1 parent 3f43b77 commit 4bc273d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ cc_library(
],
ios = [
"MOZC_DISABLE_SESSION_WATCHDOG",
"MOZC_USE_MOZC_GOOGLETEST",
"MOZC_USE_MOZC_TESTING",
"NO_USAGE_REWRITER",
],
linux = [
Expand Down
4 changes: 4 additions & 0 deletions src/testing/friend_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#ifndef MOZC_TESTING_GUNIT_PROD_H_
#define MOZC_TESTING_GUNIT_PROD_H_

#ifdef MOZC_USE_MOZC_TESTING
// The following macro is originally defined in <gtest/gtest_prod.h>.
// Here we use a private copy instead to avoid dependency on
// <gtest/gtest_prod.h> from production code.
Expand All @@ -38,5 +39,8 @@
friend class test_case_name##_##test_name##_Test
#endif // FRIEND_TEST

#else // MOZC_USE_MOZC_TESTING
#include "testing/production_stub/public/gunit_prod.h" // IWYU pragma: export
#endif // MOZC_USE_MOZC_TESTING

#endif // MOZC_TESTING_GUNIT_PROD_H_
2 changes: 2 additions & 0 deletions src/testing/googletest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#ifdef MOZC_USE_MOZC_TESTING

#include "testing/googletest.h"

Expand Down Expand Up @@ -71,3 +72,4 @@ void InitTestFlags() {

} // namespace mozc

#endif // MOZC_USE_MOZC_TESTING
4 changes: 4 additions & 0 deletions src/testing/googletest.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#ifndef MOZC_TESTING_GOOGLETEST_H_
#define MOZC_TESTING_GOOGLETEST_H_

#ifdef MOZC_USE_MOZC_TESTING
#include "absl/flags/declare.h"
#include "absl/flags/flag.h"

Expand All @@ -52,5 +53,8 @@ namespace mozc {
void InitTestFlags();
} // namespace mozc

#else // MOZC_USE_MOZC_TESTING
#include "testing/base/public/googletest.h" // IWYU pragma: export
#endif // MOZC_USE_MOZC_TESTING

#endif // MOZC_TESTING_GOOGLETEST_H_
2 changes: 2 additions & 0 deletions src/testing/googletest_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// This test is only relevant when mozc is using its own test main.
#ifdef MOZC_USE_MOZC_TESTING

#include "testing/googletest.h"

Expand Down Expand Up @@ -60,3 +61,4 @@ TEST(GoogleTest, TestFlags) {
} // namespace
} // namespace mozc

#endif // MOZC_USE_MOZC_TESTING
2 changes: 2 additions & 0 deletions src/testing/gtest_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#ifdef MOZC_USE_MOZC_TESTING

#ifdef _WIN32
#include <crtdbg.h>
Expand Down Expand Up @@ -63,3 +64,4 @@ int main(int argc, char **argv) {
return RUN_ALL_TESTS();
}

#endif // MOZC_USE_MOZC_TESTING

0 comments on commit 4bc273d

Please sign in to comment.