That's not bad and good to know.
Thanks for sharing !

Fundamentally I want to include the tests in the main though executable and
then run testing.T myself in the normal main
(Through a CLI command)

I'm willing to accept it can't be done because ts not idiomatic but thought
I'd inquire.

On Tue, Jul 9, 2019, 9:40 PM Dan Kortschak <d...@kortschak.io> wrote:

> You can ask go test to leave the test executable for you to use later.
> This is done with the -c flag. It will leave a <package>-test binary
> that takes all the flags that go test takes. This is at least similar
> to what you are asking for.
>
> On Tue, 2019-07-09 at 18:35 -0700, farid.m.zaka...@gmail.com wrote:
> > We've written some diagnostic tests that we execute during the test
> > phase
> > (go test) however I was wondering if there's an established
> > pattern for how to include tests in the final binary and execute
> > them
> > afterwards.
> >
> > The analogous version in Java would be that you could create a "test
> > JAR"
> > which contains the test classes and execute an XUnit framework
> > (JUnit)
> > programmatically yourself run the tests.
> >
>
>

-- 
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/CACCo2j%3Dy69J3E%3DiOtOfJMc5VBLfjfniu_K%3D35G8XWDJLaZ23YQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to