Re: Excluding tests with %gocheck -r not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> If you are looking for inspiration, then this [1] archive contains all 
> Fedora .spec files. Grepping for `%gocheck`, it seems that 
> golang-github-gogo-protobuf.spec is using the `-r` option this way:
> 
> 
> ~~~
> 
> %gocheck -t protoc-gen-gogo -d test/moredefaults -d test/dashfilename -d 
> test/embedconflict -d test/issue270 -r .*/unsafeunmarshaler -r 
> .*/unsafeboth -r .*/unsafemarshaler -d test/packed
> 
> ~~~
> 
> 
> Not sure if that helps.
> 
> 
> Vít
> 
> 
> [1] https://pkgs.fedoraproject.org/repo/rpm-specs-latest.tar.xz

Thanks for mentioning this Vít, I hadn't realised this existed. Will definitely make it much easier to learn from other packagers by grepping through all the spec files in the future.

> The regexp flag is advanced use and quite quirky to use. First, regexp
> means regexp as implemented by Golang (ie, not exactly usual shell
> regexp syntax). And second, the other simplified flags hide quite a lot
> of internal Golang complexity, from memory and without testing I’m
> almost certain that what you think of “./” does not exist for Golang,
> you need to qualify the path with the Go package name at least.

I think I'm realising that what the `-r` flag is referring to is regex of the path with the package name and not the filename of a test file itself, which is how I was trying to use it.

This is seemingly how it is being used in the case of golang-github-gogo-protobuf.spec at least (seemingly the only spec file existing that is using the `-r` flag). Where `-r .*/unsafeboth` would match "github.com/gogo/protobuf/test/casttype/combos/unsafeboth", "github.com/gogo/protobuf/test/castvalue/combos/unsafeboth", etc.

However it's my understanding that this would match all "*_test.go" files in these matching paths. Whereas I was hoping to exclude a single "*_test.go" at a specific path since I don't want to disable all the other tests.

Unless there is another way, I think that the only way to do what I desire is to include a patch for the deletion of the "_test.go" files I require. At least until something like https://github.com/golang/go/issues/41583 is implemented (and I assume `%gocheck` could make use of).
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux