From eec1843459bafd78041a85fa621753f6c73668ae Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 4 Jul 2018 20:30:34 +0200 Subject: [PATCH] Less Qt in strmrun test --- src/buddies/unit_tests/bdStrmrunTests.cc | 27 ++++++------------------ 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/buddies/unit_tests/bdStrmrunTests.cc b/src/buddies/unit_tests/bdStrmrunTests.cc index d3710755a..18e674af1 100644 --- a/src/buddies/unit_tests/bdStrmrunTests.cc +++ b/src/buddies/unit_tests/bdStrmrunTests.cc @@ -21,34 +21,19 @@ */ #include "tlUnitTest.h" - -#if defined(HAVE_QT) -# include -# include -#endif +#include "tlStream.h" // Testing the converter main implementation (CIF) TEST(1) { -// TODO: provide a Qt-less way of running these tests -#if defined(HAVE_QT) - QProcess process; - process.setProcessChannelMode (QProcess::MergedChannels); - - QStringList args; - std::string fp (tl::testsrc ()); fp += "/testdata/bd/strmrun.py"; - args << tl::to_qstring (fp); - process.start (tl::to_qstring ("./strmrun"), args); - bool success = process.waitForFinished (-1); + std::string path = "./strmrun " + fp; + tl::InputPipe pipe (path); + tl::InputStream is (pipe); + std::string data = is.read_all (); - QByteArray ba = process.readAll (); - EXPECT_EQ (ba.constData (), "Hello, world (0,-42;42,0)!\n"); - EXPECT_EQ (success, true); -#else - EXPECT_EQ (true, false); -#endif + EXPECT_EQ (data, "Hello, world (0,-42;42,0)!\n"); }