Re: [go-nuts] loading Directives for ptest and pxtest

2024-05-01 Thread Menno
Hi @Ian,

thanks for your answer. These fields are also empty (Reading my message 
again, I see that I was sloppy and should have specified that).

So ideally the fields 
`load.Package.Internal.Build.[Directives|TestDirective|XTestDirectives]` 
would be propagated according to the case at hand, but they seem to be 
always empty in the `ptest` and `pxtest` instances.

On Wednesday, May 1, 2024 at 11:41:46 PM UTC+2 Ian Lance Taylor wrote:

> On Wed, May 1, 2024 at 2:36 PM Menno van Rahden  
> wrote:
> >
> > Hello, I'm trying to tweak the Go stdlib test cmd a bit to support 
> certain directives, but hitting some resistance.
> >
> > I'd like to understand why the `load.Package.Internal.Build` instances 
> for `ptest` and `pxtest` (see: 
> https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/test/test.go;drc=0159150a4aa0b10f9845af94726cd67ffee93b75;l=)
>  
> don't contain the Directives, even though the fields 
> `load.Package.[EmbedPatterns|TestEmbedPatterns|XTestEmbedPatterns]` are 
> populated correctly.
> > Print-out the values for embed patterns and Directives.
> >
> > Reproducing this is pretty simple:
> > Create a project with a package with a test file and a test-package file 
> (for xtest). Add random directives (e.g. `//go:generate echo "hello world"` 
> and `//go embed `) and execute the tests with the freshly built 
> binary.
> >
> > Does anybody by any change know how to achieve that these fields are set 
> consistently and can lead me in the right direction?
>
> I haven't tried, but I would expect to find them in the TestDirectives
> and XTestDirectives fields.
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0836ead2-a4c3-4620-957a-0e986dbe6e0an%40googlegroups.com.


Re: [go-nuts] loading Directives for ptest and pxtest

2024-05-01 Thread Ian Lance Taylor
On Wed, May 1, 2024 at 2:36 PM Menno van Rahden  wrote:
>
> Hello, I'm trying to tweak the Go stdlib test cmd a bit to support certain 
> directives, but hitting some resistance.
>
> I'd like to understand why the `load.Package.Internal.Build` instances for 
> `ptest` and `pxtest` (see: 
> https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/test/test.go;drc=0159150a4aa0b10f9845af94726cd67ffee93b75;l=)
>  don't contain the Directives, even though the fields 
> `load.Package.[EmbedPatterns|TestEmbedPatterns|XTestEmbedPatterns]` are 
> populated correctly.
> Print-out the values for embed patterns and Directives.
>
> Reproducing this is pretty simple:
> Create a project with a package with a test file and a test-package file (for 
> xtest). Add random directives (e.g. `//go:generate echo "hello world"` and 
> `//go embed `) and execute the tests with the freshly built binary.
>
> Does anybody by any change know how to achieve that these fields are set 
> consistently and can lead me in the right direction?

I haven't tried, but I would expect to find them in the TestDirectives
and XTestDirectives fields.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUG%3D7s7QpGvbqzoz9huprArVuJ2wR-O9DyBStdJ_mjYpg%40mail.gmail.com.


[go-nuts] loading Directives for ptest and pxtest

2024-05-01 Thread Menno van Rahden
Hello, I'm trying to tweak the Go stdlib test cmd a bit to support certain 
directives, but hitting some resistance.

I'd like to understand why the `load.Package.Internal.Build` instances for 
`ptest` and `pxtest` (see: 
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/test/test.go;drc=0159150a4aa0b10f9845af94726cd67ffee93b75;l=)
 
don't contain the Directives, even though the fields 
`load.Package.[EmbedPatterns|TestEmbedPatterns|XTestEmbedPatterns]` are 
populated correctly.
Print-out the values for embed patterns and Directives.

Reproducing this is pretty simple:
Create a project with a package with a test file and a test-package file 
(for xtest). Add random directives (e.g. `//go:generate echo "hello world"` 
and `//go embed `) and execute the tests with the freshly built 
binary.

Does anybody by any change know how to achieve that these fields are set 
consistently and can lead me in the right direction?

Kind regards,
Menno

Sadly gopls is not properly resolving the types in VSCode for me, so I'm 
struggling going down that rabbit hole.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3f47743b-31a0-40b2-ae53-2732bf5e7fean%40googlegroups.com.