go2hx
go2hx copied to clipboard
Generate the test code and a test entry point for all imported packages
The go2hx compiler should generate the test code and a test entry point (if *_test.go files exist) for all imported packages, both for documentation purposes and testing.
Go2hx users should be able to run the "go test" code of imported Go packages themselves, to satisfy themselves that the package works on their intended target.
I agree this would be a really nice QOL addition. Perhaps whenever a library is invoked it is compiled with the test flag active? In order to generate the packages? The only potential issue I see with this is generating multiple main entry points and needing to sort out the test ones?
Let me know what you think @elliott5 :)
Compiling all Go packages with the test flag active sounds like a great way ahead @PXshadow.
There are already multiple entry-points inside the stdgo modules directory tree, one for each of the Go package tests ... and that seems to work fine, so I don't see it as a problem for all Go packages.
I think we reached a consensus later that setting the -test flag activate by default was a bad idea as it assumes user intention, which we don't want and can get in the way of users.
I think the best method to help users know what to expect before using a library is having the go2hx compiler look through the std imports and listing what ones are not passing of a library. Let me know if that makes sense to you @elliott5 .
Yes, that makes sense in the light of our recent discussion @PXshadow .
Wonderful, it's in progress I'll close this.