Move tools to a tools/src directory

Allows bash scripts to share the same name as the directory.

Add fix-tests bash script.

Change-Id: Iaf1943d50ec1fd3f382a2c7823fb7cdd13b1d9a2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47766
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton 2021-04-16 10:42:24 +00:00 committed by Commit Bot service account
parent 648b05e4e2
commit 434cd396fe
17 changed files with 42 additions and 12 deletions

30
tools/fix-tests Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Copyright 2021 The Tint Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# See https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
if [ ! -x "$(which go)" ] ; then
echo "error: go needs to be on \$PATH to use $0"
exit 1
fi
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
ROOT_DIR="$( cd "${SCRIPT_DIR}/.." >/dev/null 2>&1 && pwd )"
TARGET_EXE="$(realpath $1)"
pushd ${SCRIPT_DIR}/src/fix-tests
go run fix-tests.go "${TARGET_EXE}"
popd

View File

@ -1,5 +0,0 @@
module dawn.googlesource.com/tint/tools/fix-tests
go 1.16
require github.com/sergi/go-diff v1.2.0

View File

@ -25,7 +25,7 @@ FILES="`find src -type f` `find samples -type f`"
if command -v go &> /dev/null if command -v go &> /dev/null
then then
# Go is installed. Run cpplint in parallel for speed wins # Go is installed. Run cpplint in parallel for speed wins
go run $SCRIPT_DIR/run-parallel/main.go \ go run $SCRIPT_DIR/src/run-parallel/main.go \
--only-print-failures \ --only-print-failures \
./third_party/cpplint/cpplint/cpplint.py \ ./third_party/cpplint/cpplint/cpplint.py \
--root=$ROOT_DIR \ --root=$ROOT_DIR \

View File

@ -26,7 +26,7 @@ import (
"regexp" "regexp"
"strings" "strings"
"dawn.googlesource.com/tint/tools/fix-tests/substr" "dawn.googlesource.com/tint/tools/src/fix-tests/substr"
) )
func main() { func main() {

View File

@ -0,0 +1,5 @@
module dawn.googlesource.com/tint/tools/src/fix-tests
go 1.16
require github.com/sergi/go-diff v1.2.0

View File

@ -23,7 +23,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"dawn.googlesource.com/tint/tools/trim-includes/match" "dawn.googlesource.com/tint/tools/src/trim-includes/match"
) )
// Scan walks all files and subdirectories from root, returning those // Scan walks all files and subdirectories from root, returning those

View File

@ -0,0 +1,3 @@
module dawn.googlesource.com/tint/tools/src/trim-includes
go 1.16

View File

@ -35,7 +35,7 @@ import (
"sync" "sync"
"time" "time"
"dawn.googlesource.com/tint/tools/trim-includes/glob" "dawn.googlesource.com/tint/tools/src/trim-includes/glob"
) )
var ( var (

View File

@ -1,3 +0,0 @@
module dawn.googlesource.com/tint/tools/trim-includes
go 1.16