
Hi, what is the best way to give a test executable (BOOST_AUTO_TEST_CASE, Test suite with automated registration) a path to 'gold' files and use them? Thanks, Olaf

what is the best way to give a test executable (BOOST_AUTO_TEST_CASE, Test suite with automated registration) a path to 'gold' files and use them?
Frankly, have no idea what you refer to.
I've here a test suite with automated registration. The test should apply at some test files, and compared with some manual checked files - the 'gold' files. The question is how can I apply to the test exe the path to this files. The tests know about the files names, but not to the paths to them. The test exe is called by cmake's ctest. Thanks, Olaf

On 06/04/10 10:15, Olaf Peter wrote: [snip]
The test should apply at some test files, and compared with some manual checked files - the 'gold' files.
IOW, the 'gold' files are the expected or correct output from the test file executable and the test driver (or whatever) compares these with the actual output from test file executable to decide whether the test passed. Correct?

The test should apply at some test files, and compared with some manual checked files - the 'gold' files.
IOW, the 'gold' files are the expected or correct output from the test file executable and the test driver (or whatever) compares these with the actual output from test file executable to decide whether the test passed. Correct?
correct. Common (?) are test suites with automated registration. The tests know about the files names, but not to the paths to them due to OS specific paths etc. In my case the test exe is called by cmake's ctest. How to handle this? Using a global fixture with/without boost.program_options? Thanks, Olaf

Hi Olaf, On Sunday, 6. June 2010 21:18:45 you wrote:
Common (?) are test suites with automated registration. The tests know about the files names, but not to the paths to them due to OS specific paths etc. In my case the test exe is called by cmake's ctest.
Like this, I presume: add_test(${name} ${_executable} "${directory}" ) with some platform magic on the three cmake variables.
How to handle this? Using a global fixture with/without boost.program_options?
namespace utf = boost::unit_test::framework; and then use argc and argc provided by the test framework. For QApplication: QApplication(utf::master_test_suite().argc, utf::master_test_suite().argv); Or you can parse argc and argv with program_options. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !
participants (4)
-
Gennadiy Rozental
-
Jürgen Hunold
-
Larry Evans
-
Olaf Peter