<commit_before>#!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

""" Run the Skia GM executable. """

from build_step import BuildStep
import os
import sys


JSON_SUMMARY_FILENAME = 'actual-results.json'


class RunGM(BuildStep):
  def _Run(self):
    output_dir = os.path.join(self._device_dirs.GMDir(), self._gm_image_subdir)
    cmd = ['--verbose',
           '--writePath', output_dir,
           '--writeJsonSummaryPath', os.path.join(output_dir,
                                                  JSON_SUMMARY_FILENAME),
           '--ignoreErrorTypes',
               'IntentionallySkipped', 'MissingExpectations',
               'ExpectationsMismatch',
           '--readPath', self._device_dirs.GMExpectedDir(),
           # TODO(borenet): Re-enable --resourcePath when the test passes.
           #'--resourcePath', self._device_dirs.ResourceDir(),
           ] + self._gm_args
    # msaa16 is flaky on Macs (driver bug?) so we skip the test for now
    if sys.platform == 'darwin':
      cmd.extend(['--config', 'defaults', '~msaa16'])
    elif hasattr(self, '_device') and self._device in ['razr_i', 'nexus_10',
                                                       'galaxy_nexus']:
      cmd.extend(['--config', 'defaults', 'msaa4'])
    else:
      cmd.extend(['--config', 'defaults', 'msaa16'])
    self.RunFlavoredCmd('gm', cmd)<commit_msg>Fix NoGPU build<commit_after>#!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

""" Run the Skia GM executable. """

from build_step import BuildStep
import os
import sys


JSON_SUMMARY_FILENAME = 'actual-results.json'


class RunGM(BuildStep):
  def _Run(self):
    output_dir = os.path.join(self._device_dirs.GMDir(), self._gm_image_subdir)
    cmd = ['--verbose',
           '--writePath', output_dir,
           '--writeJsonSummaryPath', os.path.join(output_dir,
                                                  JSON_SUMMARY_FILENAME),
           '--ignoreErrorTypes',
               'IntentionallySkipped', 'MissingExpectations',
               'ExpectationsMismatch',
           '--readPath', self._device_dirs.GMExpectedDir(),
           # TODO(borenet): Re-enable --resourcePath when the test passes.
           #'--resourcePath', self._device_dirs.ResourceDir(),
           ] + self._gm_args
    # msaa16 is flaky on Macs (driver bug?) so we skip the test for now
    if sys.platform == 'darwin':
      cmd.extend(['--config', 'defaults', '~msaa16'])
    elif hasattr(self, '_device') and self._device in ['razr_i', 'nexus_10',
                                                       'galaxy_nexus']:
      cmd.extend(['--config', 'defaults', 'msaa4'])
    elif not 'NoGPU' in self._builder_name:
      cmd.extend(['--config', 'defaults', 'msaa16'])
    self.RunFlavoredCmd('gm', cmd)
{'fraction_non_alphanumeric': 0.13053536021150033, 'fraction_numerical': 0.008592200925313946, 'mean_word_length': 2.401123595505618, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4919379', 'n_tokens_mistral': 929, 'n_tokens_neox': 881, 'n_words': 231}