Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Jul 12, 2021
1 parent 5f21870 commit 8cce05d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions Engine/CLArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,12 @@ tryParseMultipleFrameRanges(const QString& args,
void
CLArgsPrivate::parse()
{
#ifdef DEBUG
qDebug() << "args:";
for (QStringList::iterator it = args.begin(); it != args.end(); ++it) {
qDebug() << *it;
}
#endif
{
QStringList::iterator it = hasToken( QString::fromUtf8("version"), QString::fromUtf8("v") );
if ( it != args.end() ) {
Expand Down Expand Up @@ -1223,13 +1229,14 @@ CLArgsPrivate::parse()
QStringList::iterator it = findFileNameWithExtension( QString::fromUtf8(NATRON_PROJECT_FILE_EXT) );
if ( it == args.end() ) {
it = findFileNameWithExtension( QString::fromUtf8("py") );
if ( ( it == args.end() ) && !isInterpreterMode && isBackground ) {
std::cout << tr("You must specify the filename of a script (.py) or a %1 project. (.%2)").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).arg( QString::fromUtf8(NATRON_PROJECT_FILE_EXT) ).toStdString() << std::endl;
if (it != args.end()) {
isPythonScript = true;
} else if (!isInterpreterMode && isBackground) {
std::cout << tr("You must specify the filename of a script or %1 project. (.%2)").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).arg( QString::fromUtf8(NATRON_PROJECT_FILE_EXT) ).toStdString() << std::endl;
error = 1;

return;
}
isPythonScript = true;
}
if ( it != args.end() ) {
filename = *it;
Expand Down Expand Up @@ -1295,6 +1302,12 @@ CLArgsPrivate::parse()
for (auto&& it: frameRanges) {
qDebug() << it.first << it.second.first << it.second.second;
}
if ( !args.empty() ) {
qDebug() << "Remaining args:";
for (QStringList::iterator it = args.begin(); it != args.end(); ++it) {
qDebug() << *it;
}
}
qDebug() << "* End of command-line parsing results.";
#endif // DEBUG

Expand Down
2 changes: 1 addition & 1 deletion Tests/wmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ GTEST_API_ int main(int argc, char **argv)
{
int argc = 0;
QStringList args;
args << QString::fromUtf8(argv[0]);

This comment has been minimized.

Copy link
@rodlie

rodlie Jul 13, 2021

Contributor

Windows: wmain.cpp:23:42: error: no matching function for call to 'QString::fromUtf8(wchar_t*&)' args << QString::fromUtf8(argv[0]);

args << QString::fromUtf8("--clear-cache");
args << QString::fromUtf8("--clear-openfx-cache");
args << QString::fromUtf8("--no-settings");
args << QString::fromUtf8("dummy.ntp");
CLArgs cl(args, true);
if (!manager.load(argc, 0, cl)) {
printf("Failed to load AppManager\n");
Expand Down

0 comments on commit 8cce05d

Please sign in to comment.