Skip to content

Commit

Permalink
Improved the testing of our Python interface.
Browse files Browse the repository at this point in the history
The idea is to have only one output file per Python test (as opposed to one for each platform and each release/debug mode).
  • Loading branch information
agarny committed Aug 10, 2020
1 parent b476b7f commit 0e30b06
Show file tree
Hide file tree
Showing 11 changed files with 1,814 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/plugins/support/PythonSupport/tests/basictests.cpp
Expand Up @@ -40,7 +40,7 @@ void BasicTests::tests()
QStringList output;

QVERIFY(!OpenCOR::runCli({ "-c", "PythonShell", OpenCOR::fileName("src/plugins/support/PythonSupport/tests/data/basictests.py") }, output));
QCOMPARE(output, OpenCOR::fileContents(OpenCOR::fileName(QString("src/plugins/support/PythonSupport/tests/data/%1/basictests.out").arg(OpenCOR::targetPlatformDir()))));
QCOMPARE(output, OpenCOR::fileContents(OpenCOR::fileName(QString("src/plugins/support/PythonSupport/tests/data/basictests.out"))));
}

//==============================================================================
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/support/PythonSupport/tests/coveragetests.cpp
Expand Up @@ -41,7 +41,8 @@ void CoverageTests::tests()
QStringList output;

QVERIFY(!OpenCOR::runCli({ "-c", "PythonShell", OpenCOR::fileName("src/plugins/support/PythonSupport/tests/data/coveragetests.py") }, output));
QCOMPARE(output, OpenCOR::fileContents(OpenCOR::fileName(QString("src/plugins/support/PythonSupport/tests/data/%1/coveragetests.out").arg(OpenCOR::targetPlatformDir()))));
qDebug("-------------------------\n%s\n--------------------\n", qPrintable(output.join("\n")));
QCOMPARE(output, OpenCOR::fileContents(OpenCOR::fileName(QString("src/plugins/support/PythonSupport/tests/data/coveragetests.out"))));
}

//==============================================================================
Expand Down

0 comments on commit 0e30b06

Please sign in to comment.