diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/generate_includes_cpp.py | 84 | ||||
-rw-r--r-- | tools/git-skia-verify | 95 | ||||
-rwxr-xr-x | tools/sanitize_source_files.py | 2 |
3 files changed, 1 insertions, 180 deletions
diff --git a/tools/generate_includes_cpp.py b/tools/generate_includes_cpp.py deleted file mode 100644 index abea1377d8..0000000000 --- a/tools/generate_includes_cpp.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/python - -''' -Copyright 2014 Google Inc. - -Use of this source code is governed by a BSD-style license that can be -found in the LICENSE file. -''' - -import os -import optparse -import posixpath -import re - - -def is_ignored(full_path, ignore_list): - for ignore_path in ignore_list: - if re.search(ignore_path, full_path, re.I): - return True - return False - - -def find_header_files(include_dirs, ignore_list): - """Return a list of all '.h' files in top_dir. - - Args: - include_dirs: Paths to the directories within which to recursively search - for files ending in '.h' - ignore_list: Paths to both files and directories that are to be excluded - from the search for headers - - Returns: - A list of all the files inside include_dirs that end in '.h', relative to - their respective include_dir that are not explicitly ignored. - """ - headers = [] - for top_dir in include_dirs: - for filename in os.listdir(top_dir): - full_path = posixpath.join(top_dir, filename) - if is_ignored(full_path, ignore_list): - continue - elif os.path.isdir(full_path): - nested_headers = find_header_files([full_path], ignore_list) - for nested_header in nested_headers: - headers.append(os.path.join(filename, nested_header)) - elif filename.endswith('.h'): - headers.append(filename) - return headers - - -def GenerateIncludeCPP(output_file, include_dirs, ignore_list): - headers = find_header_files(include_dirs, ignore_list) - - # Emit resulting source file. - with open(os.path.join(os.getcwd(), output_file), "w+") as output: - for header in headers: - output.write("#include <%s>\n" % header) - - -def main(): - parser = optparse.OptionParser() - parser.add_option("--ignore", action="store", type="string", dest="ignore", - help="file to write the processed sources array to.") - parser.set_usage("""generate_include_cpp out.cpp include_dir - out.cpp: C++ code to be generated. - include_dirs: directories to traverse for include files""") - (options, args) = parser.parse_args() - - # The MSVS gyp generator uses windows path separators so we intercept those - # strings and normalize them to our expected posix representation - include_dirs = [] - for include_dir in args[1:]: - include_dirs.append(include_dir.replace("\\", "/")) - ignore_list = options.ignore.replace("\\", "/") - - # We can strip off the relative portion of the path to ensure that when we - # compare for regex matches we don't fail based on relative path depth - ignore_list = ignore_list.replace("../", "") - - GenerateIncludeCPP(args[0], include_dirs, ignore_list.split()) - - -if __name__ == "__main__": - main() diff --git a/tools/git-skia-verify b/tools/git-skia-verify deleted file mode 100644 index c9a6c9da21..0000000000 --- a/tools/git-skia-verify +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh -# -# Copyright 2012 Intel Inc. -# -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -# -# This script builds and runs GM in current workspace with another Skia -# revision user specifies, and then compares their results. This script is -# useful when developers want to know whether their changes would cause any -# regression. -# -# As the name of this script tells, it only works for git repository. :) -# -# Usage: -# Put this script into where your PATH can find it. -# And then invoke: -# $ git skia-verify [sha1-to-compare-default-is-HEAD^] -# It would delete {before,after,diff} directory under the current directory, -# so be warned! -# After it's done, check out diff/index.html for the possible differences. - - -function say() { - # set color to yellow - tput setaf 3 - echo $1 - tput sgr0 -} - -function warn() { - # set color to red - tput setaf 1 - echo $1 - tput sgr0 -} - -REVISION="HEAD^" - -if [[ $# -eq 1 ]]; -then - REVISION="$1" -fi - -tput clear - -say "Checking sanity..." -git diff --exit-code > /dev/null -if [[ $? -ne 0 ]]; -then - warn "You have uncommitted changes!" - exit 1 -fi -git diff --cached --exit-code > /dev/null -if [[ $? -ne 0 ]]; -then - warn "You have uncommitted changes!" - exit 1 -fi - -say "Preparing Directories..." -rm -rf {before,after,diff} -mkdir {before,after,diff} - -PREVIOUS_BRANCH=`git branch --no-color | grep "^*" | awk '{ print $2}'` - -say "Running GM for current revision..." -./gyp_skia -make BUILDTYPE=Release -j10 -if [[ $? -ne 0 ]]; -then - warn "Failed to compile!" - exit 1 -fi -./out/Release/gm -w after - -say "Running GM for revision $REVISION..." -# we run the test in a detached branch -git checkout --detach "$REVISION" -./gyp_skia -make BUILDTYPE=Release -j10 -if [[ $? -ne 0 ]]; -then - warn "Failed to compile!" - say "Back to original revision..." - git checkout "$PREVIOUS_BRANCH" - exit 1 -fi -./out/Release/gm -w before - -say "Back to original revision..." -git checkout "$PREVIOUS_BRANCH" - -say "Comparing..." -./out/Release/skdiff before after diff diff --git a/tools/sanitize_source_files.py b/tools/sanitize_source_files.py index 9fd6d3272d..1f343b430f 100755 --- a/tools/sanitize_source_files.py +++ b/tools/sanitize_source_files.py @@ -11,7 +11,7 @@ import os import sys -_FILE_EXTENSIONS_TO_SANITIZE = ['cpp', 'h', 'c', 'gyp', 'gypi'] +_FILE_EXTENSIONS_TO_SANITIZE = ['cpp', 'h', 'c'] _SUBDIRS_TO_IGNORE = ['.git', '.svn', 'third_party'] |