| 17 | |
| 18 | @pytest.mark.skipif(not shutil.which('qmake'), reason="Qt not installed") |
| 19 | def test_demo(self): |
| 20 | install() |
| 21 | |
| 22 | pj = os.path.join(PJ_DIR, "juggle.py") |
| 23 | with subprocess.Popen(f'QT_QPA_PLATFORM=offscreen {pj} "{DEMO_ROUTE}/:2"', |
| 24 | stderr=subprocess.PIPE, shell=True, start_new_session=True) as p: |
| 25 | # Wait for "Done reading Rlog data" signal from the plugin |
| 26 | output = "\n" |
| 27 | with Timeout(180, error_msg=output): |
| 28 | while output.splitlines()[-1] != "Done reading Rlog data": |
| 29 | output += p.stderr.readline().decode("utf-8") |
| 30 | |
| 31 | # ensure plotjuggler didn't crash after exiting the plugin |
| 32 | time.sleep(2) |
| 33 | assert p.poll() is None |
| 34 | os.killpg(os.getpgid(p.pid), signal.SIGTERM) |
| 35 | |
| 36 | assert "Raw file read failed" not in output |
| 37 | |
| 38 | # TODO: also test that layouts successfully load |
| 39 | def test_layouts(self, subtests): |