Index: third_party/protobuf/src/google/protobuf/arena_nc_test.py |
diff --git a/third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py b/third_party/protobuf/src/google/protobuf/arena_nc_test.py |
similarity index 64% |
rename from third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py |
rename to third_party/protobuf/src/google/protobuf/arena_nc_test.py |
index 0d84b3207bdd0a5f5b7202e9ad67d6cfcf55e0d3..87a69b2afd76e6a81adb30e44d7703280535f600 100644 |
--- a/third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py |
+++ b/third_party/protobuf/src/google/protobuf/arena_nc_test.py |
@@ -1,8 +1,8 @@ |
-#! /usr/bin/python |
+#! /usr/bin/env python |
# |
# Protocol Buffers - Google's data interchange format |
# Copyright 2008 Google Inc. All rights reserved. |
-# http://code.google.com/p/protobuf/ |
+# https://developers.google.com/protocol-buffers/ |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions are |
@@ -30,16 +30,32 @@ |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-"""Tests for google.protobuf.internal.message_cpp.""" |
+"""Negative compilation unit tests for arena API.""" |
-__author__ = 'shahms@google.com (Shahms King)' |
- |
-import os |
-os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp' |
+import unittest |
+from google3.testing.pybase import fake_target_util |
import unittest |
-from google.protobuf.internal.message_test import * |
+class ArenaNcTest(unittest.TestCase): |
+ |
+ def testCompilerErrors(self): |
+ """Runs a list of tests to verify compiler error messages.""" |
+ |
+ # Defines a list of test specs, where each element is a tuple |
+ # (test name, list of regexes for matching the compiler errors). |
+ test_specs = [ |
+ ('ARENA_PRIVATE_CONSTRUCTOR', |
+ [r'calling a protected constructor']), |
+ ('SANITY', None)] |
+ |
+ fake_target_util.AssertCcCompilerErrors( |
+ self, # The current test case. |
+ 'google3/google/protobuf/arena_nc', # The fake target file. |
+ 'arena_nc.o', # The sub-target to build. |
+ test_specs # List of test specifications. |
+ ) |
+ |
if __name__ == '__main__': |
unittest.main() |