Skip to content

Commit

Permalink
[fix] Add REPO_ROOT everywhere that test/tsv-lib.sh is used
Browse files Browse the repository at this point in the history
This is annoying, but we don't have Oil's $_this_dir in shell.
  • Loading branch information
Andy C committed Feb 19, 2022
1 parent 38dae27 commit e911efd
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 6 deletions.
5 changes: 0 additions & 5 deletions benchmarks/common.sh
Expand Up @@ -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; }

Expand Down
5 changes: 4 additions & 1 deletion benchmarks/compute.sh
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/mycpp.sh
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/osh-parser.sh
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions metrics/source-code.sh
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions soil/worker.sh
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions test/stateful.sh
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions test/unit.sh
Expand Up @@ -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

Expand Down

0 comments on commit e911efd

Please sign in to comment.