| 1 |
"""Negative compilation tests for Google Mock macro MOCK_METHOD.""" |
| 2 |
|
| 3 |
import os |
| 4 |
import sys |
| 5 |
|
| 6 |
IS_LINUX = os.name == "posix" and os.uname()[0] == "Linux" |
| 7 |
if not IS_LINUX: |
| 8 |
sys.stderr.write( |
| 9 |
"WARNING: Negative compilation tests are not supported on this platform") |
| 10 |
sys.exit(0) |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
from google3.testing.pybase import fake_target_util |
| 15 |
from google3.testing.pybase import googletest |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
class GMockMethodNCTest(googletest.TestCase): |
| 21 |
"""Negative compilation tests for MOCK_METHOD.""" |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
pass |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
TEST_SPECS = [ |
| 32 |
("MOCK_METHOD_INVALID_CONST_SPEC", |
| 33 |
[r"onst cannot be recognized as a valid specification modifier"]), |
| 34 |
] |
| 35 |
|
| 36 |
|
| 37 |
fake_target_util.DefineNegativeCompilationTests( |
| 38 |
GMockMethodNCTest, |
| 39 |
"google3/third_party/googletest/googlemock/test/gmock-function-mocker_nc", |
| 40 |
"gmock-function-mocker_nc.o", TEST_SPECS) |
| 41 |
|
| 42 |
if __name__ == "__main__": |
| 43 |
googletest.main() |