def run(self):

        filename = self.inputs[0].abspath()
        self.ut_exec = getattr(self.generator, 'ut_exec', [filename])
        if getattr(self.generator, 'ut_fun', None):
            # FIXME waf 1.8 - add a return statement here?
            self.generator.ut_fun(self)

        try:
            fu = getattr(self.generator.bld, 'all_test_paths')
        except AttributeError:
            # this operation may be performed by at most #maxjobs
            fu = os.environ.copy()

            lst = []
            for g in self.generator.bld.groups:
                for tg in g:
                    if getattr(tg, 'link_task', None):
                        s = tg.link_task.outputs[0].parent.abspath()
                        if s not in lst:
                            lst.append(s)

            def add_path(dct, path, var):
                dct[var] = os.pathsep.join(Utils.to_list(path) + [os.environ.get(var, '')])

            if Utils.is_win32:
                add_path(fu, lst, 'PATH')
            elif Utils.unversioned_sys_platform() == 'darwin':
                add_path(fu, lst, 'DYLD_LIBRARY_PATH')
                add_path(fu, lst, 'LD_LIBRARY_PATH')
            else:
                add_path(fu, lst, 'LD_LIBRARY_PATH')
            self.generator.bld.all_test_paths = fu
            pass

        self.ut_exec = Utils.to_list(self.ut_exec)
        
        cwd = getattr(self.generator, 'ut_cwd', None) or self.inputs[0].parent.abspath()

        args = Utils.to_list(getattr(self.generator, 'ut_args', []))
        if args:
            self.ut_exec.extend(args)
        
        testcmd = getattr(Options.options, 'testcmd', False)
        if testcmd:
            self.ut_exec = (testcmd % self.ut_exec[0]).split(' ')

        returncode = getattr(self.generator, 'ut_rc', 0)
        if isinstance(returncode, (list,tuple)):
            returncode = int(returncode[0])
        
        #print(">>>> running %s..." % self.ut_exec[0])
        proc = Utils.subprocess.Popen(
            self.ut_exec,
            cwd=cwd,
            env=fu,
            stderr=Utils.subprocess.PIPE,
            stdout=Utils.subprocess.PIPE
            )
        (stdout, stderr) = proc.communicate()

        tup = (filename, proc.returncode, stdout, stderr, returncode)
        self.generator.utest_result = tup

        g_testlock.acquire()
        try:
            bld = self.generator.bld
            Logs.debug("ut: %r", tup)
            try:
                bld.hwaf_utest_results.append(tup)
            except AttributeError:
                bld.hwaf_utest_results = [tup]
        finally:
            #print(">>>> running %s... [done]" % self.ut_exec[0])
            g_testlock.release()
Execute the test. The execution is always successful, but the results
dataset/ETHPy150Open hwaf/hwaf/py-hwaftools/hwaf-rules.py/hwaf_utest.run