[cmake-commits] alex committed bar.cxx 1.2 1.3

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jun 13 16:26:52 EDT 2007


Update of /cvsroot/CMake/CMake/Tests/BuildDepends/Project
In directory public:/mounts/ram/cvs-serv29763/Project

Modified Files:
	bar.cxx 
Log Message:

COMP: fix test, in some cases stdout from bar was not captured correctly,
probably because the process was killed before the fflush() worked because
the busy loop blocked the processor (failing midworld test)

Alex


Index: bar.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/BuildDepends/Project/bar.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bar.cxx	23 May 2007 17:27:00 -0000	1.2
+++ bar.cxx	13 Jun 2007 20:26:50 -0000	1.3
@@ -3,7 +3,7 @@
 #include <regen.h>
 #include <noregen.h>
 
-int main()
+int main(int argc, char** argv)
 {
   /* Make sure the noregen header was not regenerated.  */
   if(strcmp("foo", noregen_string) != 0)
@@ -15,6 +15,11 @@
   /* Print out the string that should have been regenerated.  */
   printf("%s\n", regen_string);
   fflush(stdout);
-  for(;;);
+  // if any argument is used, wait forever
+  if (argc>1)
+    {
+    // wait that we get killed...
+    for(;;);
+    }
   return 0;
 }



More information about the Cmake-commits mailing list