Commit 8e2b4fef by Jamie Madill Committed by Commit Bot

Build both standalone and Chromium gTest targets.

This will let us pick the standalone test version when trying out the new test runner. GN-only change. Bug: angleproject:3162 Change-Id: I08c75c7a38aaf63c5a25cc8623eb05615cc29abb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2229068 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com>
parent 336e8915
...@@ -190,12 +190,19 @@ set_defaults("angle_static_library") { ...@@ -190,12 +190,19 @@ set_defaults("angle_static_library") {
} }
set_defaults("angle_test") { set_defaults("angle_test") {
configs = angle_common_configs configs = []
public_configs = []
# Gtest itself can't pass all the strict warning filters.
public_configs = angle_common_configs - [
"$angle_root:constructor_and_destructor_warnings",
"$angle_root:extra_warnings",
]
public_deps = [] public_deps = []
sources = [] sources = []
data = [] data = []
defines = [] defines = []
data_deps = []
main = "" main = ""
suppressed_configs = angle_remove_configs suppressed_configs = angle_remove_configs
...@@ -205,14 +212,6 @@ set_defaults("angle_test") { ...@@ -205,14 +212,6 @@ set_defaults("angle_test") {
if (!standalone_harness) { if (!standalone_harness) {
suppressed_configs -= [ "//build/config/compiler:default_include_dirs" ] suppressed_configs -= [ "//build/config/compiler:default_include_dirs" ]
} }
if (is_android) {
if (build_with_chromium) {
use_native_activity = true
} else {
use_raw_android_executable = true
}
}
} }
template("angle_executable") { template("angle_executable") {
...@@ -295,63 +294,94 @@ template("angle_static_library") { ...@@ -295,63 +294,94 @@ template("angle_static_library") {
} }
template("angle_test") { template("angle_test") {
test(target_name) { _lib = target_name + "_lib"
angle_source_set(_lib) {
testonly = true
forward_variables_from(invoker, forward_variables_from(invoker,
"*", "*",
[ [
"configs", "deps",
"suppressed_configs", "manifest",
"visibility",
]) ])
# Needed because visibility is global.
forward_variables_from(invoker, [ "visibility" ])
configs += invoker.configs
configs -= invoker.suppressed_configs + [
"$angle_root:constructor_and_destructor_warnings",
"$angle_root:extra_warnings",
]
if (is_linux && !is_component_build) {
# Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (is_android) { if (is_android) {
configs += [ "$angle_root:build_id_config" ] public_configs += [ "$angle_root:build_id_config" ]
} }
deps += [ public_deps += invoker.deps + [
"$angle_root:angle_common", "$angle_root:angle_common",
"$angle_root:includes", "$angle_root:includes",
"$angle_root/third_party/rapidjson:rapidjson", "$angle_root/third_party/rapidjson:rapidjson",
"$angle_root/util:angle_test_utils", "$angle_root/util:angle_test_utils",
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
"//third_party/googletest:gmock", "//third_party/googletest:gmock",
"//third_party/googletest:gtest", "//third_party/googletest:gtest",
] ]
sources += [ sources += [
"$angle_root/src/tests/test_utils/runner/TestSuite.cpp", "$angle_root/src/tests/test_utils/runner/TestSuite.cpp",
"$angle_root/src/tests/test_utils/runner/TestSuite.h", "$angle_root/src/tests/test_utils/runner/TestSuite.h",
] ]
}
# To use the Chromium test infrastructure we must currently use the //base test launcher.
# Eventually we could switch to using standalone testing. See http://crbug.com/837741
# TODO(jmadill): Clean up duplication as part of http://anglebug.com/3152
# To use the Chromium test infrastructure we must currently use the //base test launcher. _standalone_harness_test_name = target_name
# Eventually we could switch to using standalone testing. See http://crbug.com/837741
if (standalone_harness) { if (build_with_chromium) {
_standalone_harness_test_name = "standalone_" + target_name
test(target_name) {
public_deps = [ ":${_lib}" ]
if (invoker.main != "") { if (invoker.main != "") {
sources += [ "${invoker.main}.cpp" ] sources = [ "//gpu/${invoker.main}.cc" ]
} }
} else { deps = [ "//base/test:test_support" ]
if (invoker.main != "") { if (is_android) {
sources += [ "//gpu/${invoker.main}.cc" ] configs -= [ "//build/config/android:hide_all_but_jni" ]
}
if (is_linux && !is_component_build) {
# Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (defined(invoker.manifest)) {
manifest = invoker.manifest
} }
deps += [ "//base/test:test_support" ]
if (is_android) { if (is_android) {
configs -= [ "//build/config/android:hide_all_but_jni" ] use_native_activity = true
}
}
}
test(_standalone_harness_test_name) {
public_deps = [ ":${_lib}" ]
if (invoker.main != "") {
sources = [ "${invoker.main}.cpp" ]
}
data = invoker.data + [
"src/tests/test_utils/runner/run_gtest_angle_test.py",
"//testing/xvfb.py",
]
if (is_linux && !is_component_build) {
# Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (defined(invoker.manifest)) {
manifest = invoker.manifest
}
if (is_android) {
if (build_with_chromium) {
use_native_activity = true
} else {
use_raw_android_executable = true
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment