Skip to content

main.cpp

file tests/cli/main.cpp ยท Test suite

Entry point of nmeasim_cli_tests, the Catch2 suite that runs the command-line tool.

Source tests/cli/main.cpp

The suite has its own main instead of Catch2's default one because the tests start nmeasim with QProcess, whose pipes and process notifications need the event dispatcher that a QCoreApplication sets up for the main thread. The application is created before Catch2 runs any test case and lives until the session ends.

Summary

File-local functions

Name Description
main() Creates the Qt application and runs the Catch2 test session.

File-local functions

main()

int main(int argc, char* argv[])

Creates the Qt application and runs the Catch2 test session.

Parameters

Name Type Description
argc int Number of command-line arguments, as passed by the operating system.
argv char* Command-line arguments. They reach both Qt and Catch2, so the usual Catch2 options (test name filters, tags, reporters) select and report the test cases.

Returns int: The exit code of the Catch2 session: 0 when every selected test case passes, non-zero otherwise.

Declared in tests/cli/main.cpp:21