test_01_DeviceManager.py 文件源码

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

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def test_ValgrindOption(self):
        # Make sure that valgrind exists and is in the path
        valgrind = scatest.which('valgrind')
        if not valgrind:
            raise RuntimeError('Valgrind is not installed')

        # Let the device manager find valgrind on the path
        self._test_Valgrind('')

        # Set an explicit path to valgrind, using a symbolic link to a non-path
        # location as an additional check
        altpath = os.path.join(scatest.getSdrPath(), 'valgrind')
        os.symlink(valgrind, altpath)

        # patch for ubuntu valgrind script
        ub_patch=False
        try:
           if 'UBUNTU' in platform.linux_distribution()[0].upper():
               ub_patch=True
               valgrind_bin = scatest.which('valgrind.bin')
               os.symlink(valgrind_bin, altpath+'.bin')
        except:
             pass

        try:
            self._test_Valgrind(altpath)
        finally:
            os.unlink(altpath)
            if ub_patch:
                os.unlink(altpath+'.bin')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号