Repository navigation
docs(test): say -target takes only the architecture the tests run for - #716
Merged
Merged
Conversation
Since #593 added checkTestTargetArch, nsgo test -target accepts an arch-qualified name only for the architecture the target runs on here (this machine's for desktops, arm64 for Android) and refuses the other, but the building guide, its zh mirror, the skill and the -target help still said any arch name simply means its OS.
checkTestTargetArch ran before the host check, so on Linux -target windows_arm64 answered "the windows tests run for x64 on this machine; use -target windows", and following that only gave "the windows target runs on Windows". A desktop target whose OS is not this machine's now skips the architecture check, so the host check says where it runs, as -target macos_x64 on an x64 Linux machine already did.
houko
force-pushed
the
docs/test-target-arch
branch
from
November 18, 2026 21:57
f1df001 to
689f0c8
Compare
Collaborator
Author
|
Reviewed. Head 2151ea4, on current main (3bb9aec).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#593 (merged) added
checkTestTargetArch(cmd/nsgo/testtarget.go):nsgo test -targetnow accepts an arch-qualified name only when it names the architecture the target's tests run for here (this machine's for a desktop OS,arm64for Android) and refuses the other with the spelling to use. Four places still said any arch name simply means its OS, which was the follow-up raised in the #593 review:docs/public/en/building.mdand its mirrordocs/public/zh/building.mdskills/nsgo/references/testing.md-targetflag help incmd/nsgo/main.goIt also takes the review's optional point: the architecture check ran before the host check, so on Linux
-target windows_arm64answered "the windows tests run for x64 on this machine; use -target windows", and following that only gave "the windows target runs on Windows". A desktop target whose OS is not this machine's now skips the architecture check, so the host check says where it runs, as-target macos_x64on an x64 Linux machine already did.TestCheckTestTargetnow picks this machine's desktop target and another OS's, and fails without the change.Verification
go build ./...,go tool nsgo check -target all(Linux; Apple targets skipped there),GOOS=windows|darwin|linux go vet ./cmd/nsgogo tool nsgo test ./cmd/nsgoon Linux x64: 309 passed, 0 failed, 14 skipped;TestCheckTestTargetalso on macOS arm64go tool nsgo test -run 'Layer|Skills|Doc' .: 37 passed, 0 failedexamples/appclip: on Linux x64,windows_arm64andmacos_arm64report the host they run on,linux_arm64andandroid_x64are refused with the name to use,linux_x64runs; on macOS arm64,windows_arm64andlinux_x64report their host,macos_x64andandroid_x64are refused with the name to useruntime.GOOScomparisonScreenshots
None.