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

Add a way to identify the executable as a catch-test? #931

Closed
janwilmans opened this issue Jun 19, 2017 · 7 comments
Closed

Add a way to identify the executable as a catch-test? #931

janwilmans opened this issue Jun 19, 2017 · 7 comments

Comments

@janwilmans
Copy link

janwilmans commented Jun 19, 2017

I propose to standardise a command-line option to identify the executable as a certain kind of test:
I will propose this to boost.test and google.test as well.

See https://github.com/janwilmans/LibIdentify

@philsquared
Copy link
Collaborator

I've just pushed a commit to master that implements this. Please let me know if it looks as you intended.
(It's not in the single include yet - the next release will pick that up - but you can generate one by running the generateSingleInclude script with Python.

@janwilmans
Copy link
Author

Just tested it, works great!

D:\project\Catch>D:\project\BoostTestUi\Debug\CatchTestSample.exe --libidentify
description: A Catch test executable
category: testframework
framework: Catch Test
version: 1.9.7

@janwilmans
Copy link
Author

Could you also add the --wait-for-getchar option ? see https://github.com/janwilmans/LibIdentify at the bottom, it can have any name you want, so long as it does

			std::cout << "#Waiting" << std::endl;
			std::getchar();

before doing anything else in main()

@philsquared
Copy link
Collaborator

Done.
I've added --wait-for-keypress, which you can pass start, exit or both to (waiting for keypress on exit has been requested from time to time, so thought it makes sense to do it all together).

@philsquared
Copy link
Collaborator

Both features are now on master and dev-modernise (which will be Catch2)

@philsquared philsquared added the Resolved - pending review Issue waiting for feedback from the original author label Aug 15, 2017
@janwilmans
Copy link
Author

Great! many thanks!

@janwilmans
Copy link
Author

Tested:

 0:10:48.32 D:\project\BoostTestUi\Debug>CatchTestSample.exe --wait-for-keypress start
...waiting for enter/ return before starting

Factorial test enter
Factorial test leave
Test2 enter

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CatchTestSample.exe is a Catch v1.9.7 host application.
Run with -? for options

-------------------------------------------------------------------------------
Test2
-------------------------------------------------------------------------------
d:\project\boosttestui\catchtestsample\catchtestsample.cpp(23)
...............................................................................

d:\project\boosttestui\catchtestsample\catchtestsample.cpp(27): FAILED:
  REQUIRE( Factorial(0) == 1 )
with expansion:
  0 == 1

===============================================================================
test cases:  4 |  3 passed | 1 failed as expected
assertions: 11 | 10 passed | 1 failed as expected
 0:10:51.13 D:\project\BoostTestUi\Debug>

Works fine! good work!

@horenmar horenmar added Feature Request and removed Resolved - pending review Issue waiting for feedback from the original author labels Jan 11, 2018
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