Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move unit tests to their own module #595

Closed
crabmusket opened this issue Apr 2, 2014 · 5 comments
Closed

Move unit tests to their own module #595

crabmusket opened this issue Apr 2, 2014 · 5 comments
Labels
Milestone

Comments

@crabmusket
Copy link
Contributor

@crabmusket crabmusket commented Apr 2, 2014

There should be a single Project Generator or CMake switch to enable unit tests across all submodules. The code should be excluded from the engine if tests are not enabled.

@crabmusket crabmusket added this to the 3.6 milestone Apr 2, 2014
@Areloch
Copy link
Contributor

@Areloch Areloch commented Apr 2, 2014

That's a good idea.

I can update the TS unit test to abide this, and I'll look at bringing the existing tests to bear with it as well.

Should be pretty easy right now, as they're self contained in their own little bubble ;)

@crabmusket
Copy link
Contributor Author

@crabmusket crabmusket commented Apr 3, 2014

Yeah, and I do like that they have their own little ghetto :P. The problem is, if you want to add/remove a module that has unit tests, I don't want you to have to move source files into/out of the tests directory - the tests should be contained in the director(y|ies) added by the plugin. So overall I think a #define is probably our best bet, and just wrap all the unit test files in it. Unless someone else has a better solution.

@crabmusket
Copy link
Contributor Author

@crabmusket crabmusket commented Apr 22, 2014

Torque 2D simply uses the TORQUE_SHIPPING flag to exclude tests. I find this acceptable, and it's probably best practise to try and align T2D and T3D somewhat. They also use googletest which I like the idea of. I've had brief experience with it before. Making a new ticket for discussion.

@crabmusket
Copy link
Contributor Author

@crabmusket crabmusket commented Jul 9, 2014

As part of #706, I've added a flag TORQUE_TESTS_ENABLED which controls the unit tests, and is set by including a module called 'testing'. Just seems like a good idea to only include the 30,000 line google test library if users really want it. If they're not going to bother with tests, then ignore it.

@LuisAntonRebollo
Copy link
Contributor

@LuisAntonRebollo LuisAntonRebollo commented Jul 9, 2014

Good idea to add the flag.

I'll try this weekend.

@crabmusket crabmusket closed this Jul 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants