mirror of
https://github.com/sstephenson/bats.git
synced 2024-09-29 20:48:27 +02:00
exec-test: Invoke bats-preprocess directly
Also, `bats-preprocess` now converts DOS/Windows CRLF line endings.
This commit is contained in:
parent
d294689bdd
commit
cf9a3b8af4
|
@ -327,7 +327,7 @@ BATS_OUT="${BATS_TMPNAME}.out"
|
||||||
|
|
||||||
bats_preprocess_source() {
|
bats_preprocess_source() {
|
||||||
BATS_TEST_SOURCE="${BATS_TMPNAME}.src"
|
BATS_TEST_SOURCE="${BATS_TMPNAME}.src"
|
||||||
{ tr -d '\r' < "$BATS_TEST_FILENAME"; echo; } | bats-preprocess > "$BATS_TEST_SOURCE"
|
. bats-preprocess <<< "$(< "$BATS_TEST_FILENAME")"$'\n' > "$BATS_TEST_SOURCE"
|
||||||
trap "bats_cleanup_preprocessed_source" err exit
|
trap "bats_cleanup_preprocessed_source" err exit
|
||||||
trap "bats_cleanup_preprocessed_source; exit 1" int
|
trap "bats_cleanup_preprocessed_source; exit 1" int
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ index=0
|
||||||
pattern='^ *@test *([^ ].*) *\{ *(.*)$'
|
pattern='^ *@test *([^ ].*) *\{ *(.*)$'
|
||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
|
line="${line//$'\r'}"
|
||||||
let index+=1
|
let index+=1
|
||||||
if [[ "$line" =~ $pattern ]]; then
|
if [[ "$line" =~ $pattern ]]; then
|
||||||
quoted_name="${BASH_REMATCH[1]}"
|
quoted_name="${BASH_REMATCH[1]}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user