I use the Test::Harness module all the time in testing my C++ code. All it took was to write an extremely minimal C++ class to emulate the behavior of Test::More, then put appropriate targets in a Makefile to do the following things when I type make test:
where foo.t is the C++ test executable.#!/usr/bin/perl print `./foo.t`;
where ${VERBOSE} is either 1 or 0 and ${TEST_SCRIPTS} is the list of Perl one-liners.perl -e 'use Test::Harness qw(&runtests $$verbose); $$verbose=${VERBOS +E}; runtests @ARGV;' ${TEST_SCRIPTS} 2>/dev/null
Whether this is the best or easiest approach, I'm not sure. I came up with it on my own after much searching for freely-available unit testing code in C++. But if anyone can suggest such code, or a better way to go about testing C++ using the Perl Test:: modules, I would love your input.
-- Mike
--
just,my${.02}
In reply to Re: is perl testing the answer?
by thelenm
in thread is perl testing the answer?
by bobdeath
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |