From b19dc1fcc422403960409ec23db2c715b0dee4ca Mon Sep 17 00:00:00 2001 From: Niranjan Yardi Date: Mon, 6 Nov 2023 15:10:52 -0800 Subject: [PATCH] Build evergreen specific test targets only for non-windows platforms (#1918) Reverts #1873 partially Internal failures have been fixed. Note: For disabling evergreen specific tests for all non-evergreen platforms b/309493306 needs to be fixed. As a step in the right direction we are just disabling building disabling evergreen specific tests for windows platforms at the moment. b/302008891 (cherry picked from commit 34c46ca924b9b9e612e748d1fa8ac4f6ac4fde91) --- starboard/elf_loader/BUILD.gn | 52 ++++++++++---------- starboard/loader_app/BUILD.gn | 90 +++++++++++++++++++---------------- 2 files changed, 77 insertions(+), 65 deletions(-) diff --git a/starboard/elf_loader/BUILD.gn b/starboard/elf_loader/BUILD.gn index bca4126edd2b..64149322a481 100644 --- a/starboard/elf_loader/BUILD.gn +++ b/starboard/elf_loader/BUILD.gn @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//starboard/build/config/os_definitions.gni") + _elf_loader_sources = [ "dynamic_section.cc", "dynamic_section.h", @@ -88,7 +90,7 @@ if (sb_is_evergreen_compatible) { } } -if (current_toolchain == starboard_toolchain) { +if (current_toolchain == starboard_toolchain && !is_host_win) { target(starboard_level_final_executable_type, "elf_loader_sandbox") { data_deps = [ "//third_party/icu:icudata" ] if (cobalt_font_package == "empty") { @@ -152,31 +154,33 @@ if (sb_is_evergreen_compatible) { } } -target(gtest_target_type, "elf_loader_test") { - testonly = true - sources = [ "//starboard/common/test_main.cc" ] - deps = [ - "//starboard", - "//testing/gmock", - "//testing/gtest", - ] - - if (target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm" || - target_cpu == "arm64") { - sources += [ - "dynamic_section_test.cc", - "elf_header_test.cc", - "elf_loader_test.cc", - "lz4_file_impl_test.cc", - "program_table_test.cc", - "relocations_test.cc", - ] - deps += [ - ":copy_elf_loader_testdata", - ":elf_loader", +if (!is_host_win) { + target(gtest_target_type, "elf_loader_test") { + testonly = true + sources = [ "//starboard/common/test_main.cc" ] + deps = [ + "//starboard", + "//testing/gmock", + "//testing/gtest", ] - data_deps = [ ":copy_elf_loader_testdata" ] + if (target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm" || + target_cpu == "arm64") { + sources += [ + "dynamic_section_test.cc", + "elf_header_test.cc", + "elf_loader_test.cc", + "lz4_file_impl_test.cc", + "program_table_test.cc", + "relocations_test.cc", + ] + deps += [ + ":copy_elf_loader_testdata", + ":elf_loader", + ] + + data_deps = [ ":copy_elf_loader_testdata" ] + } } } diff --git a/starboard/loader_app/BUILD.gn b/starboard/loader_app/BUILD.gn index e0384a1797c9..1e3ec6ed1fe5 100644 --- a/starboard/loader_app/BUILD.gn +++ b/starboard/loader_app/BUILD.gn @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//starboard/build/config/os_definitions.gni") + _common_loader_app_sources = [ "loader_app.cc", "loader_app_switches.cc", @@ -247,20 +249,22 @@ static_library("installation_manager") { ] } -target(gtest_target_type, "installation_manager_test") { - testonly = true - sources = [ - "//starboard/common/test_main.cc", - "installation_manager_test.cc", - "pending_restart_test.cc", - ] - deps = [ - ":installation_manager", - ":installation_store_proto", - ":pending_restart", - "//testing/gmock", - "//testing/gtest", - ] +if (!is_host_win) { + target(gtest_target_type, "installation_manager_test") { + testonly = true + sources = [ + "//starboard/common/test_main.cc", + "installation_manager_test.cc", + "pending_restart_test.cc", + ] + deps = [ + ":installation_manager", + ":installation_store_proto", + ":pending_restart", + "//testing/gmock", + "//testing/gtest", + ] + } } static_library("slot_management") { @@ -285,22 +289,24 @@ static_library("slot_management") { } } -target(gtest_target_type, "slot_management_test") { - testonly = true - sources = [ - "//starboard/common/test_main.cc", - "slot_management_test.cc", - ] - deps = [ - ":app_key_files", - ":drain_file", - ":installation_manager", - ":installation_store_proto", - ":slot_management", - "//starboard/elf_loader:sabi_string", - "//testing/gmock", - "//testing/gtest", - ] +if (!is_host_win) { + target(gtest_target_type, "slot_management_test") { + testonly = true + sources = [ + "//starboard/common/test_main.cc", + "slot_management_test.cc", + ] + deps = [ + ":app_key_files", + ":drain_file", + ":installation_manager", + ":installation_store_proto", + ":slot_management", + "//starboard/elf_loader:sabi_string", + "//testing/gmock", + "//testing/gtest", + ] + } } static_library("pending_restart") { @@ -332,15 +338,17 @@ static_library("reset_evergreen_update") { deps = [ "//starboard" ] } -target(gtest_target_type, "reset_evergreen_update_test") { - testonly = true - sources = [ - "//starboard/common/test_main.cc", - "reset_evergreen_update_test.cc", - ] - deps = [ - ":reset_evergreen_update", - "//testing/gmock", - "//testing/gtest", - ] +if (!is_host_win) { + target(gtest_target_type, "reset_evergreen_update_test") { + testonly = true + sources = [ + "//starboard/common/test_main.cc", + "reset_evergreen_update_test.cc", + ] + deps = [ + ":reset_evergreen_update", + "//testing/gmock", + "//testing/gtest", + ] + } }