-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Is possible call a TEST_CASE like a function? #666
Comments
Catch already registers tests and runs them automatically with TEST_CASE. See the tutorial: Put this in
If you want to do stuff before / after the tests are run, see own-main:
If you look at the source code for TEST_CASE, it creates a semi-random function name. Use the following to be able to call these test functions from others (which you shouldn't do probably):
|
Ty very much , i accept this. |
@czipperz "it creates a semi-random function name" |
Yes, it's just based on the line number, but that is unpredictable when you edit the file |
Hi, i just started using Catch, so forgive me if this is a dumb question or i miss some reference on the documentation, i want to call from a
int main(){...}
function under the 'src' folder theTEST_CASE
allocate under the 'test' folder, like this:File src/main.cpp
File test/TestRectangle.cpp
Is possible doing that?
Ty in advance.
The text was updated successfully, but these errors were encountered: