initial commit
This commit is contained in:
commit
9d20827c46
2469 changed files with 470994 additions and 0 deletions
63
qcm/tests.qcm
Normal file
63
qcm/tests.qcm
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: Tests
|
||||
arg: with-cppunit-inc=[path],Path to CppUnit include files
|
||||
arg: with-cppunit-lib=[path],Path to CppUnit library files
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// qc_tests
|
||||
//----------------------------------------------------------------------------
|
||||
class qc_tests : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_tests(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "tests"; }
|
||||
QString shortname() const { return "tests"; }
|
||||
bool exec()
|
||||
{
|
||||
QString s = conf->getenv("QC_WITH_CPPUNIT_INC");
|
||||
if(!s.isEmpty()) {
|
||||
if(!conf->checkHeader(s, "cppunit/Test.h")) {
|
||||
conf->debug("CppUnit includes not found!");
|
||||
return false;
|
||||
}
|
||||
conf->addIncludePath(s);
|
||||
}
|
||||
else {
|
||||
QStringList sl;
|
||||
sl += "/usr/include";
|
||||
sl += "/usr/local/include";
|
||||
sl += "/sw/include";
|
||||
sl += "/opt/local/include";
|
||||
if(!conf->findHeader("cppunit/Test.h", sl, &s)) {
|
||||
conf->debug("CppUnit includes not found!");
|
||||
return false;
|
||||
}
|
||||
conf->addIncludePath(s);
|
||||
}
|
||||
|
||||
s = conf->getenv("QC_WITH_CPPUNIT_LIB");
|
||||
if(!s.isEmpty()) {
|
||||
if(!conf->checkLibrary(s, "cppunit")) {
|
||||
conf->debug("CppUnit libraries not found!");
|
||||
return false;
|
||||
}
|
||||
conf->addLib(QString("-L") + s);
|
||||
}
|
||||
else {
|
||||
if(!conf->findLibrary("cppunit", &s)) {
|
||||
conf->debug("CppUnit libraries not found!");
|
||||
return false;
|
||||
}
|
||||
if (!s.isEmpty())
|
||||
conf->addLib(QString("-L") + s);
|
||||
}
|
||||
|
||||
conf->addLib("-lcppunit");
|
||||
conf->addExtra("CONFIG += tests");
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
Reference in a new issue