aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-01-08 15:11:23 -0800
committerGravatar Vijay Pai <vpai@google.com>2018-01-08 15:13:51 -0800
commit9d2d84382e317e5c8a149c497bfe9408af12b038 (patch)
tree57f54c34c8e9e59165ee6d24dd86a485a761f5a1
parentb425fc79da44da1641b03cd6c35cf13b542c8e07 (diff)
Add portability tests on Linux to make sure that build with -fno-exceptions
continues to work
-rw-r--r--Makefile25
-rw-r--r--build.yaml4
-rw-r--r--tools/run_tests/generated/configs.json5
-rwxr-xr-xtools/run_tests/run_tests_matrix.py9
4 files changed, 34 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 339c52294a..01b7a6879a 100644
--- a/Makefile
+++ b/Makefile
@@ -142,14 +142,14 @@ LDXX_asan-noleaks = clang++
CPPFLAGS_asan-noleaks = -O0 -fsanitize-coverage=edge -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS
LDFLAGS_asan-noleaks = -fsanitize=address
-VALID_CONFIG_c++-compat = 1
-CC_c++-compat = $(DEFAULT_CC)
-CXX_c++-compat = $(DEFAULT_CXX)
-LD_c++-compat = $(DEFAULT_CC)
-LDXX_c++-compat = $(DEFAULT_CXX)
-CFLAGS_c++-compat = -Wc++-compat
-CPPFLAGS_c++-compat = -O0
-DEFINES_c++-compat = _DEBUG DEBUG
+VALID_CONFIG_noexcept = 1
+CC_noexcept = $(DEFAULT_CC)
+CXX_noexcept = $(DEFAULT_CXX)
+LD_noexcept = $(DEFAULT_CC)
+LDXX_noexcept = $(DEFAULT_CXX)
+CXXFLAGS_noexcept = -fno-exceptions
+CPPFLAGS_noexcept = -O2
+DEFINES_noexcept = NDEBUG
VALID_CONFIG_ubsan = 1
REQUIRE_CUSTOM_LIBRARIES_ubsan = 1
@@ -205,6 +205,15 @@ LDXX_lto = $(DEFAULT_CXX)
CPPFLAGS_lto = -O2
DEFINES_lto = NDEBUG
+VALID_CONFIG_c++-compat = 1
+CC_c++-compat = $(DEFAULT_CC)
+CXX_c++-compat = $(DEFAULT_CXX)
+LD_c++-compat = $(DEFAULT_CC)
+LDXX_c++-compat = $(DEFAULT_CXX)
+CFLAGS_c++-compat = -Wc++-compat
+CPPFLAGS_c++-compat = -O0
+DEFINES_c++-compat = _DEBUG DEBUG
+
VALID_CONFIG_mutrace = 1
CC_mutrace = $(DEFAULT_CC)
CXX_mutrace = $(DEFAULT_CXX)
diff --git a/build.yaml b/build.yaml
index e217504dd5..238d9970ab 100644
--- a/build.yaml
+++ b/build.yaml
@@ -4966,6 +4966,10 @@ configs:
CPPFLAGS: -O3 -fno-omit-frame-pointer
DEFINES: NDEBUG
LDFLAGS: -rdynamic
+ noexcept:
+ CPPFLAGS: -O2
+ CXXFLAGS: -fno-exceptions
+ DEFINES: NDEBUG
opt:
CPPFLAGS: -O2
DEFINES: NDEBUG
diff --git a/tools/run_tests/generated/configs.json b/tools/run_tests/generated/configs.json
index fee8290efe..a14340cb7b 100644
--- a/tools/run_tests/generated/configs.json
+++ b/tools/run_tests/generated/configs.json
@@ -42,7 +42,7 @@
}
},
{
- "config": "c++-compat"
+ "config": "noexcept"
},
{
"config": "ubsan",
@@ -74,6 +74,9 @@
"config": "lto"
},
{
+ "config": "c++-compat"
+ },
+ {
"config": "mutrace"
},
{
diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py
index ac90bef5ac..344035478b 100755
--- a/tools/run_tests/run_tests_matrix.py
+++ b/tools/run_tests/run_tests_matrix.py
@@ -313,6 +313,15 @@ def _create_portability_test_jobs(extra_args=[],
extra_envs={'GRPC_DNS_RESOLVER': 'ares'},
timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
+ # C and C++ with no-exceptions on Linux
+ test_jobs += _generate_jobs(
+ languages=['c', 'c++'],
+ configs=['noexcept'],
+ platforms=['linux'],
+ labels=['portability', 'corelang'],
+ extra_args=extra_args,
+ timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
+
# TODO(zyc): Turn on this test after adding c-ares support on windows.
# C with the c-ares DNS resolver on Windows
# test_jobs += _generate_jobs(languages=['c'],