test_01_DeviceManager.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def _test_Valgrind(self, valgrind):
        # Clear the device cache to prevent false positives
        deviceCacheDir = os.path.join(scatest.getSdrCache(), ".ExecutableDevice_node", "ExecutableDevice1")
        shutil.rmtree(deviceCacheDir, ignore_errors=True)

        os.environ['VALGRIND'] = valgrind
        try:
            # Checking that the node and device launch as expected
            nb, devMgr = self.launchDeviceManager("/nodes/test_ExecutableDevice_node/DeviceManager.dcd.xml")
        finally:
            del os.environ['VALGRIND']

        self.assertFalse(devMgr is None)
        self.assertEquals(len(devMgr._get_registeredDevices()), 1, msg='device failed to launch with valgrind')
        children = getChildren(nb.pid)
        self.assertEqual(len(children), 1)
        devMgr.shutdown()

        # Check that a valgrind logfile exists
        logfile = os.path.join(deviceCacheDir, 'valgrind.%s.log' % children[0])
        self.assertTrue(os.path.exists(logfile))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号