def run_once(self):
        failures = []
        # TODO(ihf): shard this test into multiple control files.
        test_names = [
            'alloc_varying_sizes', 'alloc_usage', 'api', 'gralloc_order',
            'uninitialized_handle', 'freed_handle', 'mapping', 'perform',
            'ycbcr', 'async'
        ]

        # Run the tests and capture stdout.
        for test_name in test_names:
            try:
                cmd = '%s %s' % (_ANDROID_EXEC, test_name)
                stdout = arc._android_shell(cmd)
            except Exception:
                logging.error('Exception running %s', cmd)
            # Look for the regular expression indicating success.
            match = re.search(r'\[  PASSED  \]', stdout)
            if not match:
                failures.append(test_name)
                logging.error(stdout)
            else:
                logging.debug(stdout)

        if failures:
            gpu_family = utils.get_gpu_family()
            raise error.TestFail('Failed: gralloc on %s in %s.' %
                                 (gpu_family, failures))
    def run_once(self):
        gpu_family = utils.get_gpu_family()
        if not self._executables:
            raise error.TestFail('Failed: No executables found on %s' %
                                 gpu_family)

        logging.debug('Running %d executables', len(self._executables))
        for executable in self._executables:
            try:
                cmd = '%s %s' % (executable, _OPTION)
                stdout = arc._android_shell(cmd)
            except Exception:
                logging.error('Exception running %s', cmd)
                raise error.TestFail('Failed: gralloc on %s' % gpu_family)
            # Look for the regular expression indicating failure.
            for line in stdout.splitlines():
                match = re.search(r'\[  FAILED  \]', stdout)
                if match:
                    self.add_failures(line)
                    logging.error(line)
                else:
                    logging.debug(stdout)

        if self.get_failures():
            raise error.TestFail('Failed: gralloc on %s in %s.' %
                                 (gpu_family, self.get_failures()))
예제 #3
0
 def arc_setup(self):
     super(graphics_Gralloc, self).arc_setup()
     # Get the executable from CrOS and copy it to Android container. Due to
     # weird permission issues inside the container, we first have to copy
     # the test to /sdcard/, then move it to a /data/ subdirectory we create.
     # The permissions on the exectuable have to be modified as well.
     arc.adb_root()
     cmd = os.path.join(self.srcdir, 'gralloctest')
     arc.adb_cmd('-e push %s %s' % (cmd, _SDCARD_EXEC))
     arc._android_shell('mkdir -p %s' % (_EXEC_DIRECTORY))
     arc._android_shell('mv %s %s' % (_SDCARD_EXEC, _ANDROID_EXEC))
     arc._android_shell('chmod o+rwx %s' % (_ANDROID_EXEC))
예제 #4
0
    def run_once(self):
        try:
            cmd = '%s %s' % (_ANDROID_EXEC, _OPTION)
            stdout = arc._android_shell(cmd)
        except Exception:
            logging.error('Exception running %s', cmd)
        # Look for the regular expression indicating failure.
        for line in stdout.splitlines():
            match = re.search(r'\[  FAILED  \]', stdout)
            if match:
                self.add_failures(line)
                logging.error(line)
            else:
                logging.debug(stdout)

        if self.get_failures():
            gpu_family = utils.get_gpu_family()
            raise error.TestFail('Failed: gralloc on %s in %s.' %
                                 (gpu_family, self.get_failures()))
    def arc_setup(self):
        super(graphics_Gralloc, self).arc_setup()
        # Get the executable from CrOS and copy it to Android container. Due to
        # weird permission issues inside the container, we first have to copy
        # the test to /sdcard/, then move it to a /data/ subdirectory we create.
        # The permissions on the exectuable have to be modified as well.
        arc.adb_root()
        arc._android_shell('mkdir -p %s' % (_EXEC_DIR))
        for binary in _POSSIBLE_BINARIES:
            cros_path = os.path.join(_CROS_BIN_DIR, binary)
            cros_cmd = '%s %s' % (_TEST_COMMAND, cros_path)
            job = utils.run(cros_cmd, ignore_status=True)
            if job.exit_status:
                continue

            sdcard_path = os.path.join(_SDCARD_DIR, binary)
            arc.adb_cmd('-e push %s %s' % (cros_path, sdcard_path))

            exec_path = os.path.join(_EXEC_DIR, binary)
            arc._android_shell('mv %s %s' % (sdcard_path, exec_path))
            arc._android_shell('chmod o+rwx %s' % (exec_path))
            self._executables.append(exec_path)
예제 #6
0
 def arc_teardown(self):
     # Remove test contents from Android container.
     arc._android_shell('rm -rf %s' % (_EXEC_DIRECTORY))
     super(graphics_Gralloc, self).arc_teardown()
 def arc_teardown(self):
     for executable in self._executables:
         # Remove test contents from Android container.
         arc._android_shell('rm -rf %s' % (executable))
     super(graphics_Gralloc, self).arc_teardown()