smarty / gunit

xUnit-style test fixture adapter for go test
Other
119 stars 11 forks source link

Allow external test files. #4

Closed GeorgeErickson closed 8 years ago

GeorgeErickson commented 8 years ago

Make external test (e.g. *_test packages) work.

GeorgeErickson commented 8 years ago

To make this work for packages that have internal and external tests would require a much bigger refactor. Since you would possibly be writing two generated files per package.

mdwhatcott commented 8 years ago

So, the merge conflict is my fault and is also easy to resolve. I just have one remaining concern:

What if a developer defines tests in one file that are 'inside' the package and then defines tests in another file that are 'outside' the package. With your changes, all generated tests would be defined in the 'outside' package, which would prevent the tests that were defined in the 'inside' package from compiling. It seems like to really do this right you would have to generate two files, one for the tests defined 'inside' the package (if any) and one file for the tests defined 'outside' the package (if any).

mdwhatcott commented 6 years ago

@GeorgeErickson - Since gunit no longer generates test code (we use reflection to enumerate the test cases of a fixture struct) you can now define fixtures internally and externally out-of-the-box.