Improved the CMakeLists.txt just slightly. Provided a default, weak-attributed main function into libdeepstate so that tests don't need to define them. The weak attribute means that any main function defined by libfuzzer will be a strong symbol and take over, so there won't be a conflict. Adjusted examples accordingly to omit now redundant conditionally-compiled main functions, as that leaked out too many underlying details.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <deepstate/DeepState.hpp>
|
||||
|
||||
#include <climits>
|
||||
using namespace deepstate;
|
||||
|
||||
DEEPSTATE_NOINLINE int ident1(int x) {
|
||||
@@ -40,9 +40,3 @@ TEST(SignedInteger, MultiplicationOverflow) {
|
||||
<< x << " squared overflowed.";
|
||||
}
|
||||
|
||||
#ifndef LIBFUZZER
|
||||
int main(int argc, char *argv[]) {
|
||||
DeepState_InitOptions(argc, argv);
|
||||
return DeepState_Run();
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user