-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Reading from stdin was effectively broken
Introduced in 582d6f7 because of dumb copy-paste error.
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Should be run from build folder | ||
|
||
|
||
RAPIDGZIP='src/tools/rapidgzip' | ||
export RAPIDGZIP | ||
|
||
function echoerr() { echo "$@" 1>&2; } | ||
|
||
returnError() | ||
{ | ||
local lineNumber message | ||
if [ $# -eq 2 ]; then | ||
lineNumber=:$1 | ||
message=$2 | ||
else | ||
message=$* | ||
fi | ||
|
||
echoerr -e "\e[37m${FUNCNAME[1]}$lineNumber <- ${FUNCNAME[*]:2}\e[0m" | ||
echoerr -e "\e[37m$message\e[0m" | ||
echoerr -e '\e[31mTEST FAILED!\e[0m' | ||
|
||
exit 1 | ||
} | ||
|
||
|
||
# Tests with stdin are hard to do in Catch2, so do them here. | ||
[[ "$( cat ../src/tests/data/base64-256KiB.gz | $RAPIDGZIP --count )" -eq 262144 ]] || | ||
returnError "$LINENO" 'Stdin count test failed!' | ||
|
||
echo -e '\e[32mAll tests ran successfully.\e[0m' |