Thank you all for the feedback. It is appreciated.

   - *So it is not possible via the golang platform native capabilities... *
   - The Visual Studio Code (IDE) offers a good feature building on top of
   the -run flag
      - It parses the file to test, recovers all the test function names of
      the given file and builds a regex that matches all the functions
to run...
      so later that regex would be the argument passed to the -run flag.
   - I look for this because I don't want to run all the tests of the
   package, only the ones present in a given file.




El sáb, 29 jun 2024 a las 6:43, Marcello H (<marcel...@gmail.com>) escribió:

> You can look at how your IDE would do it, or, you can put a build tag in
> and only test that build tag
>
> Op zaterdag 29 juni 2024 om 03:37:28 UTC+2 schreef Kurtis Rader:
>
>> On Fri, Jun 28, 2024 at 3:25 PM Victor Manuel “Vitu” Giordano <
>> vituc...@gmail.com> wrote:
>>
>>> I struggle with performing all the tests written in a file that requires
>>> symbols defined on other files of the same package.
>>>
>>> For example
>>> $ go test practice_resource_test.go
>>> # command-line-arguments [command-line-arguments.test]
>>> ./practice_resource_test.go:11:12: undefined: PracticeResource
>>> ./practice_resource_test.go:12:12: undefined: PracticeResource
>>> FAIL command-line-arguments [build failed]
>>> FAIL
>>>
>>> The symbol PracticeResource is defined in a file called
>>> practice_resource present at the same package.
>>>
>>
>> If the reason you're doing this is because you want to run only the tests
>> in that file rather than all tests for the package you should instead use
>> the "-run" flag to specify which tests you want to run and specify a
>> package rather than a single test file. See "go help testflag".
>>
>> --
>> Kurtis Rader
>> Caretaker of the exceptional canines Junior and Hank
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/5noIceyeCa4/unsubscribe.
> To unsubscribe from this group and all its topics, 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/60fc7fef-fa41-4d1d-bed5-83e9705dcdfcn%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/60fc7fef-fa41-4d1d-bed5-83e9705dcdfcn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
V

-- 
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/CAPUu9stTgNWy9%2Bi8aAFy%2BhWH2xJC25EnKw6GbGW8pnRKH9%3Dsog%40mail.gmail.com.

Reply via email to