Well the fundamental problem is the point when the test gets run.

I would think your solution requires that the test has already been executed.  
For my purposes, that is way too premature and costly.

I was hoping that other people may have run into this situation and would be 
willing to share their best practices.  It would be a shame for me to develop 
NIH and continuosly reinvent the wheel.  The whole point of cmake for me is to 
avoid reinventing the wheel.  The whole point of me querying the list about 
this type of stuff is to share collective experiences about an issue I don't 
believe to be covered in the online or book documentation.

Am I correct in saying that execute_processs cannot be invoked from add_test?  
Writing a perl script to execute the test and run the diff would be a simple 
exercise, and I guess that is what I'll have to do.


Regards,

Juan


-----Original Message-----
From: Alan W. Irwin [mailto:[EMAIL PROTECTED]
Sent: Sun 9/23/2007 10:08 PM
To: Sanchez, Juan
Cc: Aleix; CMake ML
Subject: RE: [CMake] ctest question
 
On 2007-09-23 18:48-0700 Sanchez, Juan wrote:

> Would this sound reasonable?
> Write a perl script with the name of the test program and golden result file 
> as arguments.  The perl script will run the test and compare the output 
> results with the golden file and then return success or failure.

ADD_TEST allows you to run any command-line executable with any arguments.

You will find that running a script (bash or perl or python) is one option,
but that may be overkill for what you appear to want.  Why not simply run
diff, i.e.,

ADD_TEST(my_first_test diff -q goldenfile testfile)

?

If that hint isn't quite right for your needs, then I suggest you implement
some really simple examples of ADD_TEST to see what is possible, and what
the resulting ctest results look like.  (That is one of the nice things
about cmake; you can make a complete example with just a few lines to
explore and learn about any part of it.)
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to