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

Problem with compilation flags. #185

Closed
NicoMuleo opened this issue Oct 11, 2024 · 3 comments · Fixed by #187
Closed

Problem with compilation flags. #185

NicoMuleo opened this issue Oct 11, 2024 · 3 comments · Fixed by #187
Labels
bug:confirmed Something isn't working (confirmed)

Comments

@NicoMuleo
Copy link

NicoMuleo commented Oct 11, 2024

when using compialtion flags:

#define SNITCH_WITH_ALL_REPORTERS 0
#define SNITCH_WITH_TEAMCITY_REPORTER 0
#define SNITCH_WITH_CATCH2_REPORTER 0

reporters should not be included in the build. However, I could find reporters in the in the test executable:

$ ./tests_snitch --list-reporters
xml
console
teamcity

I tested this feature using the basic example from Snitch documentation.

I am using header only snitch library

Code

the full code is

#define SNITCH_IMPLEMENTATION
#define SNITCH_WITH_ALL_REPORTERS 0
#define SNITCH_WITH_TEAMCITY_REPORTER 0
#define SNITCH_WITH_CATCH2_REPORTER 0

#include <snitch/snitch_all.hpp>

unsigned int Factorial( unsigned int number ) {
    return number <= 1 ? number : Factorial(number-1)*number;
}

TEST_CASE("Factorials are computed", "[factorial]" ) {
    REQUIRE( Factorial(0) == 1 ); // this check will fail
    REQUIRE( Factorial(1) == 1 );
    REQUIRE( Factorial(2) == 2 );
    REQUIRE( Factorial(3) == 6 );
    REQUIRE( Factorial(10) == 3628800 );
}
@cschreib cschreib added the bug:confirmed Something isn't working (confirmed) label Oct 11, 2024
@cschreib
Copy link
Member

Oops. Silly mistake, will fix now.

@cschreib
Copy link
Member

Should be fixed now, thanks for reporting the problem.

@NicoMuleo
Copy link
Author

Thank you for the quick response!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed Something isn't working (confirmed)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants