From e911efd61d9100f8709450efe1c6bdc9304be38c Mon Sep 17 00:00:00 2001 From: Andy C Date: Sat, 19 Feb 2022 17:13:53 -0500 Subject: [PATCH] [fix] Add REPO_ROOT everywhere that test/tsv-lib.sh is used This is annoying, but we don't have Oil's $_this_dir in shell. --- benchmarks/common.sh | 5 ----- benchmarks/compute.sh | 5 ++++- benchmarks/mycpp.sh | 4 ++++ benchmarks/osh-parser.sh | 4 ++++ metrics/source-code.sh | 3 +++ soil/worker.sh | 3 +++ test/stateful.sh | 3 +++ test/unit.sh | 3 +++ 8 files changed, 24 insertions(+), 6 deletions(-) diff --git a/benchmarks/common.sh b/benchmarks/common.sh index 1b22c92d03..d727e6f894 100644 --- a/benchmarks/common.sh +++ b/benchmarks/common.sh @@ -57,11 +57,6 @@ csv2html() { web/table/csv2html.py --css-class-pattern 'special ^osh' "$@" } -# TODO: Conslidate with test/tsv-lib.sh -tsv2html() { - web/table/csv2html.py --tsv "$@" -} - # also in metrics/source-code.sh hist() { sort | uniq -c | sort -n; } diff --git a/benchmarks/compute.sh b/benchmarks/compute.sh index 46ad48770a..c3f8713cfd 100755 --- a/benchmarks/compute.sh +++ b/benchmarks/compute.sh @@ -29,8 +29,11 @@ set -o nounset set -o pipefail set -o errexit +REPO_ROOT=$(cd $(dirname $0)/.. && pwd) +readonly REPO_ROOT + source benchmarks/common.sh # filter-provenance -source test/tsv-lib.sh +source test/tsv-lib.sh # tsv2html readonly BASE_DIR=_tmp/compute readonly OSH_CC=_bin/osh_eval.opt.stripped diff --git a/benchmarks/mycpp.sh b/benchmarks/mycpp.sh index 1b34eba54c..a506cea84e 100755 --- a/benchmarks/mycpp.sh +++ b/benchmarks/mycpp.sh @@ -9,7 +9,11 @@ set -o nounset set -o pipefail set -o errexit +REPO_ROOT=$(cd $(dirname $0)/.. && pwd) +readonly REPO_ROOT + source benchmarks/common.sh +source test/tsv-lib.sh # tsv2html print-report() { local in_dir=$1 diff --git a/benchmarks/osh-parser.sh b/benchmarks/osh-parser.sh index ffa86da048..e2b053796d 100755 --- a/benchmarks/osh-parser.sh +++ b/benchmarks/osh-parser.sh @@ -23,6 +23,10 @@ set -o nounset set -o pipefail set -o errexit +REPO_ROOT=$(cd $(dirname $0)/.. && pwd) # tsv-lib.sh uses this +readonly REPO_ROOT + +source test/tsv-lib.sh # tsv2html source test/common.sh # die source benchmarks/common.sh # die diff --git a/metrics/source-code.sh b/metrics/source-code.sh index 17a0c4a503..ed60293b58 100755 --- a/metrics/source-code.sh +++ b/metrics/source-code.sh @@ -9,6 +9,9 @@ set -o nounset set -o pipefail set -o errexit +REPO_ROOT=$(cd $(dirname $0)/.. && pwd) # tsv-lib.sh uses this +readonly REPO_ROOT + source test/common.sh source test/tsv-lib.sh diff --git a/soil/worker.sh b/soil/worker.sh index 34438269ac..cc7bb7a9ac 100755 --- a/soil/worker.sh +++ b/soil/worker.sh @@ -9,6 +9,9 @@ set -o nounset set -o pipefail set -o errexit +REPO_ROOT=$(cd $(dirname $0)/.. && pwd) # tsv-lib.sh uses this +readonly REPO_ROOT + source soil/common.sh source test/tsv-lib.sh diff --git a/test/stateful.sh b/test/stateful.sh index 570f419c40..2d315011ea 100755 --- a/test/stateful.sh +++ b/test/stateful.sh @@ -18,6 +18,9 @@ set -o nounset set -o pipefail set -o errexit +REPO_ROOT=$(cd $(dirname $0)/.. && pwd) # tsv-lib.sh uses this +readonly REPO_ROOT + source test/common.sh # log source test/tsv-lib.sh diff --git a/test/unit.sh b/test/unit.sh index b5263cf089..a57fb62b3c 100755 --- a/test/unit.sh +++ b/test/unit.sh @@ -16,6 +16,9 @@ set -o pipefail set -o errexit shopt -s strict:all 2>/dev/null || true # dogfood for OSH +REPO_ROOT=$(cd $(dirname $0)/.. && pwd) # tsv-lib.sh uses this +readonly REPO_ROOT + source test/common.sh source test/tsv-lib.sh