Просмотр исходного кода

BUG: Custom commands should actually generate the files they claim to generate.

Brad King 19 лет назад
Родитель
Сommit
e1c110d244
2 измененных файлов с 15 добавлено и 3 удалено
  1. 12 2
      Tests/Wrapping/Wrap.c
  2. 3 1
      Tests/Wrapping/fakefluid.cxx

+ 12 - 2
Tests/Wrapping/Wrap.c

@@ -1,7 +1,17 @@
 #include <stdio.h>
 
-int main()
+int main(int argc, const char* argv[])
 {
-  printf("Hello\n");
+  FILE* fout = fopen(argv[argc-1], "w");
+  printf("Wrap creating \"%s\"\n", argv[argc-1]);
+  if(fout)
+    {
+    fprintf(fout, "int foo() { return 0; }\n");
+    fclose(fout);
+    }
+  else
+    {
+    return -1;
+    }
   return 0;
 }

+ 3 - 1
Tests/Wrapping/fakefluid.cxx

@@ -4,8 +4,10 @@ int main(int ac, char** av)
 {
   for(int i =0; i < ac; ++i)
     {
-    if(strcmp(av[i], "-o") == 0)
+    if(strcmp(av[i], "-o") == 0 ||
+       strcmp(av[i], "-h") == 0)
       {
+      fprintf(stdout, "fakefluid is creating file \"%s\"\n", av[i+1]);
       FILE* file = fopen(av[i+1], "w");
       fprintf(file, "// hello\n");
       fclose(file);