mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Don't create GUI application to run unit tests
This commit is contained in:
@@ -91,6 +91,33 @@ int main(int argc, char *argv[])
|
||||
|
||||
QApplication::setApplicationVersion(lit(FULL_VERSION_STRING));
|
||||
|
||||
// shortcut here so we can run this with a non-GUI application
|
||||
#if !defined(RELEASE)
|
||||
if(QString::fromUtf8(argv[1]) == lit("--unittest"))
|
||||
{
|
||||
QCoreApplication application(argc, argv);
|
||||
PythonContext::GlobalInit();
|
||||
|
||||
bool errors = false;
|
||||
|
||||
qInfo() << "Checking python binding consistency.";
|
||||
|
||||
{
|
||||
PythonContextHandle py;
|
||||
errors = py.ctx().CheckInterfaces();
|
||||
}
|
||||
|
||||
if(errors)
|
||||
{
|
||||
qCritical() << "Found errors in python bindings. Please fix!";
|
||||
return 1;
|
||||
}
|
||||
|
||||
qInfo() << "Python bindings are consistent.";
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
QApplication application(argc, argv);
|
||||
|
||||
QCommandLineParser parser;
|
||||
@@ -129,11 +156,6 @@ int main(int argc, char *argv[])
|
||||
hideOption(crashReport);
|
||||
parser.addOption(crashReport);
|
||||
|
||||
#if !defined(RELEASE)
|
||||
QCommandLineOption unittests(lit("unittest"), tr("Run unit tests"));
|
||||
parser.addOption(unittests);
|
||||
#endif
|
||||
|
||||
parser.addPositionalArgument(lit("filename"), tr("The file to open."));
|
||||
|
||||
bool parsedCommands = parser.parse(application.arguments());
|
||||
@@ -160,31 +182,6 @@ int main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined(RELEASE)
|
||||
if(parser.isSet(unittests))
|
||||
{
|
||||
PythonContext::GlobalInit();
|
||||
|
||||
bool errors = false;
|
||||
|
||||
qInfo() << "Checking python binding consistency.";
|
||||
|
||||
{
|
||||
PythonContextHandle py;
|
||||
errors = py.ctx().CheckInterfaces();
|
||||
}
|
||||
|
||||
if(errors)
|
||||
{
|
||||
qCritical() << "Found errors in python bindings. Please fix!";
|
||||
return 1;
|
||||
}
|
||||
|
||||
qInfo() << "Python bindings are consistent.";
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(parser.isSet(installLayer))
|
||||
{
|
||||
qInfo() << "Updating Vulkan layer registration";
|
||||
|
||||
Reference in New Issue
Block a user