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

Switch to using Catch for testing #103

Open
Vraiment opened this issue Jul 12, 2017 · 3 comments
Open

Switch to using Catch for testing #103

Vraiment opened this issue Jul 12, 2017 · 3 comments

Comments

@Vraiment
Copy link
Contributor

Vraiment commented Jul 12, 2017

As I commented in another issue I would suggest switching to Catch it works kind of the same way as the custom framework libSDL2pp uses for testings but has several cool features like:

  • Naming and tagging the test cases
  • Control test executing and output features (like coloring and format) via arguments
  • Reuse test code by leveraging the stack, silly example:
TEST_CASE("Test modifying the string", "[std_containers][modifying_operators]") {
	std::string testString = "Some string";
	SECTION("Test concatenation") {
		REQUIRE(testString + " extra" == "Some string extra")
	}
	SECTION("Test push_back") {
		REQUIRE(testString.push_back('.') == "Some string.")
	}
}
@vladimirgamalyan
Copy link
Contributor

one another alternative: https://github.com/onqtam/doctest

@Vraiment
Copy link
Contributor Author

I advised Catch because is the one I know, after going quickly through doctest's documentation it seems it has several small extra features (like convenient assertion macros).

From a quick search in google it seems that Catch is more mature than doctest and just slightly slower than Catch. The other important difference is Catch uses the BOOST license and doctest uses the MIT license.

@AMDmi3
Copy link
Member

AMDmi3 commented Jul 12, 2017

I like the idea. It should probably be more robust than my homegrown library. Gotta investigate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants