Created
June 29, 2021 10:49
-
-
Save olegsinavski/882cfcd596929dc98cc716057b64f3ef to your computer and use it in GitHub Desktop.
Ctest assert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define REQUIRE( ... ) \ | |
do { \ | |
if( !( __VA_ARGS__ ) ) { \ | |
std::stringstream ss; \ | |
ss << "Unit test assert [ " \ | |
<< ( #__VA_ARGS__ ) \ | |
<< " ] failed in line [ " \ | |
<< __LINE__ \ | |
<< " ] file [ " \ | |
<< __FILE__ << " ]" \ | |
<< std::endl; \ | |
throw std::runtime_error(ss.str()); \ | |
} \ | |
} while( false ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment