コード例 #1
0
    def test_04(self):
        self.logger.debug("test of 2 seqential task sets in a concurrent task")
        t1 = make_CompoundTask(Task.SequentialTaskset, 't4a', 3)
        t2 = make_CompoundTask(Task.SequentialTaskset, 't4b', 3)
        t = Task.ConcurrentAndTaskset([t1, t2])
        t.init_and_start(self.parentTask)

        res = t.wait()
        resTuple = (t1.result, t2.result)
        self.logger.debug("resTuple = %s" % (str(resTuple)))
        self.logger.debug("Total time is %f" % t.getExecutionTime())
        # test against the values assigned to final task in each make_CompoundTask()
        self.assertTrue('t4b_2' in resTuple)
        self.assertTrue('t4a_2' in resTuple)
コード例 #2
0
    def test_06(self):
        self.logger.debug("test of 2 concurrent tasks in a concurrent task")
        t1 = make_CompoundTask(Task.ConcurrentAndTaskset, 't6a', 3)
        t2 = make_CompoundTask(Task.ConcurrentAndTaskset, 't6b', 3)
        t = Task.ConcurrentAndTaskset([t1, t2])
        t.init_and_start(self.parentTask)

        res = t.wait()
        resTuple = (t1.taskseq[0].result, t1.taskseq[1].result,
                    t1.taskseq[2].result, t2.taskseq[0].result,
                    t2.taskseq[1].result, t2.taskseq[2].result)
        self.logger.debug("resTuple = %s" % (str(resTuple)))
        self.logger.debug("Total time is %f" % t.getExecutionTime())
        self.assertTrue(t.taskseq[0].result in ('t6a_0', 't6a_1', 't6a_2'))
        self.assertTrue(t.taskseq[1].result in ('t6b_0', 't6b_1', 't6b_2'))
        # test against the values assigned in make_CompoundTask()
        self.assertEqual('t6a_0', resTuple[0])
        self.assertEqual('t6a_1', resTuple[1])
        self.assertEqual('t6a_2', resTuple[2])
        self.assertEqual('t6b_0', resTuple[3])
        self.assertEqual('t6b_1', resTuple[4])
        self.assertEqual('t6b_2', resTuple[5])