Port of schuchert.wikispaces.com


cpptraining.ConfiguringTheProjectForCppUTest

cpptraining.ConfiguringTheProjectForCppUTest

Configuring the Project for CppUTest

#include <CppUTest/CommandLineTestRunner.h>

int main(int argc, char **argv) {
	return CommandLineTestRunner::RunAllTests(argc, argv);
}
OK (0 tests, 0 ran, 0 checks, 0 ignored, 0 filtered out, 0 ms)

Alternative main()

If you’d like to see a list of tests and the time each takes to run, you can either:

#include <CppUTest/CommandLineTestRunner.h>

int main() {
	const char* args[] = { "", "-v" };
	return CommandLineTestRunner::RunAllTests(2, args);
}

Comments

" Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.