Enhancing pymod tests (added lib, more robust, added pya also for Qt bindings off)

This commit is contained in:
Matthias Koefferlein 2023-03-07 23:44:12 +01:00
parent 3e8f03ef5f
commit c3e831f96f
1 changed files with 7 additions and 3 deletions

View File

@ -51,6 +51,8 @@ int run_pymodtest (tl::TestBase *_this, const std::string &fn)
fp += "/pymod/"; fp += "/pymod/";
fp += fn; fp += fn;
int status = 0;
std::string text; std::string text;
{ {
std::string cmd; std::string cmd;
@ -71,12 +73,14 @@ int run_pymodtest (tl::TestBase *_this, const std::string &fn)
tl::InputPipe pipe (cmd); tl::InputPipe pipe (cmd);
tl::InputStream is (pipe); tl::InputStream is (pipe);
text = is.read_all (); text = is.read_all ();
status = pipe.wait ();
} }
tl::info << text; tl::info << text;
EXPECT_EQ (text.find ("OK") != std::string::npos, true); EXPECT_EQ (text.find ("OK") != std::string::npos, true);
return 0; return status;
} }
#define PYMODTEST(n, file) \ #define PYMODTEST(n, file) \
@ -88,6 +92,8 @@ PYMODTEST (import_tl, "import_tl.py")
PYMODTEST (import_db, "import_db.py") PYMODTEST (import_db, "import_db.py")
PYMODTEST (import_rdb, "import_rdb.py") PYMODTEST (import_rdb, "import_rdb.py")
PYMODTEST (import_lay, "import_lay.py") PYMODTEST (import_lay, "import_lay.py")
PYMODTEST (import_lib, "import_lib.py")
PYMODTEST (pya_tests, "pya_tests.py")
#if defined(HAVE_QT) && defined(HAVE_QTBINDINGS) #if defined(HAVE_QT) && defined(HAVE_QTBINDINGS)
@ -143,6 +149,4 @@ PYMODTEST (import_QtCore5Compat, "import_QtCore5Compat.py")
#endif #endif
PYMODTEST (import_pya, "pya_tests.py")
#endif #endif