32 #ifdef USING_XMLPATTERNS 92 #if defined(USING_XMLPATTERNS) || defined(USING_LIBXML2) 99 QString directory = CommandLine->
GetValue(QStringLiteral(
"xsdtest")).toString();
100 LOG(VB_GENERAL, LOG_INFO, QStringLiteral(
"Starting XSD test from %1").arg(directory));
102 QString basexsd = QStringLiteral(
"%1/html/torc.xsd").arg(
GetTorcShareDir());
104 if (fullxsd.isEmpty())
112 filters << QStringLiteral(
"*.xml");
114 QStringList testfiles = dir.entryList(filters, QDir::Files | QDir::NoDotAndDotDot | QDir::Readable | QDir::CaseSensitive, QDir::Name);
116 if (testfiles.isEmpty())
118 LOG(VB_GENERAL, LOG_INFO, QStringLiteral(
"Failed to find any xml files in %1").arg(dir.path()));
123 LOG(VB_GENERAL, LOG_INFO, QStringLiteral(
"Found %1 files.").arg(testfiles.size()));
125 foreach (
const QString &file, testfiles)
128 QString path = directory +
"/" + file;
129 LOG(VB_GENERAL, LOG_INFO, path);
133 LOG(VB_GENERAL, LOG_ERR, QStringLiteral(
"Unexpected pass: %1").arg(path));
139 LOG(VB_GENERAL, LOG_INFO, QStringLiteral(
"All test files failed as expected"));
141 LOG(VB_GENERAL, LOG_ERR, QStringLiteral(
"%1 unexpected passes.").arg(passcount));
147 LOG(VB_GENERAL, LOG_INFO, QStringLiteral(
"XML validation not available."));
static qint16 Create(TorcCommandLine *CommandLine, bool Init=true)
static QByteArray GetCustomisedXSD(const QString &BaseXSDFile)
#define TORC_EXIT_INVALID_CMDLINE
QString GetTorcShareDir(void)
Return the path to the installed Torc shared resources.
Torc command line handler.
#define TORC_EXIT_UNKOWN_ERROR
static int RunXSDTestSuite(TorcCommandLine *CommandLine)
Perform XSD test validation of XML files.
static void TearDown(void)
#define LOG(_MASK_, _LEVEL_, _STRING_)
QVariant GetValue(const QString &Key)
Return the value associated with Key or an invalid QVariant if the option is not present.
bool Validated(void) const