66export SHELLSPEC_VERSION=' 0.16.0'
77export SHELLSPEC_PATH=' '
88export SHELLSPEC_ROOT=' '
9+ export SHELLSPEC_PROJECT_ROOT=' '
10+ export SHELLSPEC_PROJECT_NAME=' '
911export SHELLSPEC_LIB=' '
1012export SHELLSPEC_LIBEXEC=' '
1113export SHELLSPEC_SPECDIR=' '
@@ -47,9 +49,10 @@ export SHELLSPEC_SEED=''
4749export SHELLSPEC_COVERAGEDIR=' '
4850export SHELLSPEC_KCOV=' '
4951export SHELLSPEC_KCOV_PATH=' kcov'
50- export SHELLSPEC_KCOV_IN_FILE=' '
5152export SHELLSPEC_KCOV_COMMON_OPTS=' '
5253export SHELLSPEC_KCOV_OPTS=' '
54+ export SHELLSPEC_KCOV_FILENAME=' '
55+ export SHELLSPEC_KCOV_IN_FILE=' '
5356
5457# shellcheck disable=SC2039
5558export SHELLSPEC_HOSTNAME=${HOSTNAME:- localhost}
@@ -77,19 +80,12 @@ SHELLSPEC_REPORTERLIB="$SHELLSPEC_LIB/libexec/reporter"
7780. " $SHELLSPEC_LIB /libexec/shellspec.sh"
7881
7982SHELLSPEC_LIBEXEC=" $SHELLSPEC_ROOT /libexec"
80- SHELLSPEC_SPECDIR=$PWD /spec
81- SHELLSPEC_REPORTDIR=$PWD /report
82- SHELLSPEC_COVERAGEDIR=$PWD /coverage
83- SHELLSPEC_LOAD_PATH=$SHELLSPEC_SPECDIR :$SHELLSPEC_LIB :$SHELLSPEC_REPORTERLIB
84-
85- SHELLSPEC_KCOV_IN_FILE=${PWD##*/ } _specs.kcov-in-file
86- while IFS= read -r option; do
87- SHELLSPEC_KCOV_COMMON_OPTS=" $SHELLSPEC_KCOV_COMMON_OPTS$option "
88- done << HERE
89- --include-path=.
90- --include-pattern=.sh
91- --exclude-pattern=/coverage/,/spec/,/report/
92- HERE
83+ SHELLSPEC_PROJECT_ROOT=" $PWD "
84+ SHELLSPEC_PROJECT_NAME=" ${SHELLSPEC_PROJECT_ROOT##*/ } "
85+ SHELLSPEC_SPECDIR=" $SHELLSPEC_PROJECT_ROOT /spec"
86+ SHELLSPEC_REPORTDIR=" $SHELLSPEC_PROJECT_ROOT /report"
87+ SHELLSPEC_COVERAGEDIR=" $SHELLSPEC_PROJECT_ROOT /coverage"
88+ SHELLSPEC_LOAD_PATH=" $SHELLSPEC_SPECDIR :$SHELLSPEC_LIB :$SHELLSPEC_REPORTERLIB "
9389
9490SHELLSPEC_UNIXTIME=$( date +%s)
9591SHELLSPEC_TMPBASE=" ${SHELLSPEC_TMPDIR%/ } /shellspec.$SHELLSPEC_UNIXTIME .$$ "
@@ -106,6 +102,17 @@ elif command_path ksh > /dev/null; then
106102 SHELLSPEC_TIME=" ksh $SHELLSPEC_TIME "
107103fi
108104
105+ while IFS= read -r option; do
106+ SHELLSPEC_KCOV_COMMON_OPTS=" $SHELLSPEC_KCOV_COMMON_OPTS$option "
107+ done << HERE
108+ --path-strip-level=1
109+ --include-path=.
110+ --include-pattern=.sh
111+ --exclude-pattern=/coverage/,/spec/,/report/
112+ HERE
113+ SHELLSPEC_KCOV_FILENAME=" $SHELLSPEC_PROJECT_NAME [specfiles]"
114+ SHELLSPEC_KCOV_IN_FILE=" $SHELLSPEC_PROJECT_ROOT /$SHELLSPEC_KCOV_FILENAME "
115+
109116usage () {
110117while IFS= read -r line; do echo " $line " ; done << USAGE
111118Usage: shellspec [options] [files or directories]
@@ -168,6 +175,7 @@ Usage: shellspec [options] [files or directories]
168175 Note: Requires kcov and bash, parallel execution is ignored.
169176 --kcov-path PATH Specify kcov path [default: kcov]
170177 --kcov-common-options OPTIONS Specify kcov common options [default: see below]
178+ --path-strip-level=1
171179 --include-path=.
172180 --include-pattern=.sh
173181 --exclude-pattern=/coverage/,/spec/,/report/
0 commit comments