testonly in the top-level

1 view
Skip to first unread message

Shuhei Takahashi (nya)

unread,
Dec 17, 2025, 12:59:25 AM (yesterday) Dec 17
to gn-...@chromium.org
Hi GN devs,

I see some usages of top-level "testonly = true" in Chromium:

The comment says it marks all targets as testonly, but is it true? I don't see any mention in the GN's reference guide. Although I see a similar description for visibility.

Thanks,
Shuhei / nya

--
Shuhei Takahashi a.k.a nya <n...@google.com>

Roland McGrath

unread,
Dec 17, 2025, 1:21:43 PM (yesterday) Dec 17
to Shuhei Takahashi (nya), gn-...@chromium.org
Variable propagation from outer scopes to inner scopes is a bit subtle in GN.  Anything that looks for `invoker.testonly` directly will find it when it was defined in a containing scope.  Things that use `forward_variables_from` will not find it with the `"*"` wildcard, but will find it when named explicitly.

Shuhei Takahashi (nya)

unread,
Dec 17, 2025, 10:25:48 PM (18 hours ago) Dec 17
to Roland McGrath, gn-...@chromium.org
That makes sense, thanks Roland for explanation! 

Shuhei Takahashi a.k.a nya <n...@google.com>

2025年12月18日(木) 3:21 Roland McGrath <mcgr...@chromium.org>:
Reply all
Reply to author
Forward
0 new messages