summaryrefslogtreecommitdiff
path: root/Tests/CustomCommand/check_command_line.c.in
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CustomCommand/check_command_line.c.in')
-rw-r--r--Tests/CustomCommand/check_command_line.c.in36
1 files changed, 36 insertions, 0 deletions
diff --git a/Tests/CustomCommand/check_command_line.c.in b/Tests/CustomCommand/check_command_line.c.in
new file mode 100644
index 000000000..e0e0d2142
--- /dev/null
+++ b/Tests/CustomCommand/check_command_line.c.in
@@ -0,0 +1,36 @@
+#include <stdio.h>
+#include <string.h>
+
+const char* expected_arguments[] =
+{
+@EXPECTED_ARGUMENTS@ 0
+};
+
+int main(int argc, const char* argv[])
+{
+ const char** a = argv+1;
+ const char** e = expected_arguments;
+ (void)argc;
+ for(;*a && *e; ++a, ++e)
+ {
+ if(strcmp(*a, *e) != 0)
+ {
+ fprintf(stderr, "Argument [%s] does not match expected [%s].\n",
+ *a, *e);
+ return 1;
+ }
+ else
+ {
+#if defined(CHECK_COMMAND_LINE_VERBOSE)
+ printf("[%s]\n", *a);
+#endif
+ }
+ }
+ if(*a || *e)
+ {
+ fprintf(stderr, "Number of arguments does not match expected.\n");
+ return 1;
+ }
+ printf("Command line escapes work!\n");
+ return 0;
+}