2016-05-04 20:30:19 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
// Usage:
|
|
|
|
//
|
|
|
|
// /path/to/program arg1 [arg2 [...]]
|
|
|
|
//
|
|
|
|
// Return EXIT_SUCCESS if 'generated_exe_emulator_expected'
|
|
|
|
// string was found in <arg1>.
|
|
|
|
// Return EXIT_FAILURE if 'generated_exe_emulator_unexpected'
|
|
|
|
// string was found in <arg1>.
|
|
|
|
|
|
|
|
int main(int argc, const char* argv[])
|
|
|
|
{
|
|
|
|
const char* substring_failure = "generated_exe_emulator_unexpected";
|
|
|
|
const char* substring_success = "generated_exe_emulator_expected";
|
|
|
|
const char* str = argv[1];
|
2016-05-16 17:34:04 +03:00
|
|
|
if (argc < 2) {
|
2016-05-04 20:30:19 +03:00
|
|
|
return EXIT_FAILURE;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
if (strstr(str, substring_success) != 0) {
|
2016-05-04 20:30:19 +03:00
|
|
|
return EXIT_SUCCESS;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
if (strstr(str, substring_failure) != 0) {
|
2016-05-04 20:30:19 +03:00
|
|
|
return EXIT_FAILURE;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
fprintf(stderr, "Failed to find string '%s' in '%s'\n", substring_success,
|
|
|
|
str);
|
2016-05-04 20:30:19 +03:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|