Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion authored and fmeum committed Dec 28, 2023
1 parent 19257b5 commit 0bf30c8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ tasks:
- tests/core/cgo/generate_imported_dylib.sh
build_targets:
- "//..."
- "--"
- "-//tests/core/cross:darwin_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:linux_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:windows_go_cross_cgo" # Doesn't work before bazel 6
test_targets:
- "//..."
# Bzlmod tests require Bazel 6+
Expand All @@ -28,6 +32,10 @@ tasks:
- "--config=incompatible"
build_targets:
- "//..."
- "--"
- "-//tests/core/cross:darwin_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:linux_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:windows_go_cross_cgo" # Doesn't work before bazel 6
test_targets:
- "//..."
debian11_zig_cc:
Expand Down Expand Up @@ -67,6 +75,10 @@ tasks:
- "--host_crosstool_top=@local_config_apple_cc//:toolchain"
build_targets:
- "//..."
- "--"
- "-//tests/core/cross:darwin_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:linux_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:windows_go_cross_cgo" # Doesn't work before bazel 6
test_flags:
- "--apple_crosstool_top=@local_config_apple_cc//:toolchain"
- "--crosstool_top=@local_config_apple_cc//:toolchain"
Expand All @@ -78,6 +90,10 @@ tasks:
- tests/core/cgo/generate_imported_dylib.sh
build_targets:
- "//..."
- "--"
- "-//tests/core/cross:darwin_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:linux_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:windows_go_cross_cgo" # Doesn't work before bazel 6
test_flags:
# Some tests depend on this feature being disabled. However, because it's
# enabled by default in the rbe_ubuntu1604 platform, we cannot simply remove
Expand Down Expand Up @@ -243,6 +259,9 @@ tasks:
- "-//tests/legacy/test_chdir:go_default_test"
- "-//tests/legacy/test_rundir:go_default_test"
- "-//tests/legacy/transitive_data:go_default_test"
- "-//tests/core/cross:darwin_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:linux_go_cross_cgo" # Doesn't work before bazel 6
- "-//tests/core/cross:windows_go_cross_cgo" # Doesn't work before bazel 6
test_flags:
- '--action_env=PATH=C:\tools\msys64\usr\bin;C:\tools\msys64\bin;C:\tools\msys64\mingw64\bin;C:\python3\Scripts\;C:\python3;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Google\Compute Engine\sysprep;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\tools\msys64\usr\bin;c:\openjdk\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\CMake\bin;c:\ninja;c:\bazel;c:\buildkite'
# On Windows CI, bazel (bazelisk) needs %LocalAppData% to find the cache directory.
Expand Down
24 changes: 24 additions & 0 deletions tests/core/cross/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,30 @@ go_cross_binary(
target = ":native_bin",
)

# Because pure = "on" on the underlying target, this doesn't actually need cgo (and won't try to use it).
# This target ensures that (from Bazel 6) we don't require a C++ toolchain if we're not actually going to use cgo.
go_cross_binary(
name = "windows_go_cross_cgo",
platform = "@io_bazel_rules_go//go/toolchain:windows_amd64_cgo",
target = ":native_bin",
)

# Because pure = "on" on the underlying target, this doesn't actually need cgo (and won't try to use it).
# This target ensures that (from Bazel 6) we don't require a C++ toolchain if we're not actually going to use cgo.
go_cross_binary(
name = "linux_go_cross_cgo",
platform = "@io_bazel_rules_go//go/toolchain:linux_amd64_cgo",
target = ":native_bin",
)

# Because pure = "on" on the underlying target, this doesn't actually need cgo (and won't try to use it).
# This target ensures that (from Bazel 6) we don't require a C++ toolchain if we're not actually going to use cgo.
go_cross_binary(
name = "darwin_go_cross_cgo",
platform = "@io_bazel_rules_go//go/toolchain:darwin_amd64_cgo",
target = ":native_bin",
)

go_library(
name = "platform_lib",
srcs = select({
Expand Down

0 comments on commit 0bf30c8

Please sign in to comment.