run-file () { local spec_name=$1; shift; local spec_file=spec/$spec_name.test.sh; local suite; suite=$(test/sh_spec.py --print-spec-suite $spec_file); local spec_subdir; case $suite in osh) spec_subdir='osh-cpp' ;; ysh) spec_subdir='ysh-cpp' ;; *) die "Invalid suite $suite" ;; esac; local base_dir=_tmp/spec/$spec_subdir; mkdir -v -p $base_dir; sh-spec $spec_file --timeout 10 --oils-bin-dir $PWD/bin --oils-cpp-bin-dir $REPO_ROOT/_bin/cxx-asan --tsv-output $base_dir/${spec_name}.tsv "$@" } ysh-special-vars: spec test case results

Results for ysh-special-vars.test.sh

statusyshysh-cpp
pass 55
total55
caseyshysh-cppdescription
0pass pass _this_dir in main and oshrc
1pass pass _this_dir not set on stdin
2pass pass _this_dir in sourced module
3pass pass _this_dir not affected by 'cd'
4pass pass _this_dir used with relative path
10 passed, 0 OK, 0 not implemented, 0 BUG, 0 failed, 0 timeouts, 0 cases skipped