summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMattias Wadman <mattias.wadman@gmail.com>2023-08-12 20:18:45 +0200
committerGitHub <noreply@github.com>2023-08-12 20:18:45 +0200
commitfdab39bc7b8d41c1ae410f03a42afc10a9322c99 (patch)
treebbc3acf5253585e348a720b4706bd0427e81e392 /tests
parent5a52553a3be6ef3e44928cab20f96cdaa3e8b5dc (diff)
Build windows 64bit binary using UCRT64 (#2832)
* Build windows 64bit binary using UCRT64 Is the default and recommended msystem setting. Will produce binaries that are compatible with windows 10 and later. Also run tests for 32bit build. Related to #2831 * Use jq -b in tests/shtest * Add Windows strptime * Make Windows-optional tests not run on Windows again --------- Co-authored-by: Nicolas Williams <nico@cryptonector.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/shtest26
1 files changed, 21 insertions, 5 deletions
diff --git a/tests/shtest b/tests/shtest
index ee6cb36e..52a82190 100755
--- a/tests/shtest
+++ b/tests/shtest
@@ -2,6 +2,9 @@
. "${0%/*}/setup" "$@"
+JQ_NO_B=$JQ
+JQ="$JQ -b"
+
PATH=$JQBASEDIR:$PATH $JQBASEDIR/tests/jq-f-test.sh > /dev/null
if [ -f "$JQBASEDIR/.libs/libinject_errors.so" ]; then
@@ -493,7 +496,12 @@ cmp $d/color $d/expect
cmp $d/warning $d/expect_warning
# Check $NO_COLOR
-if command -v script >/dev/null 2>&1; then
+case "$(uname -s)" in
+MSYS*) test_no_color=false;;
+MINGW*) test_no_color=false;;
+*) test_no_color=true;;
+esac
+if $test_no_color && command -v script >/dev/null 2>&1; then
unset NO_COLOR
if script -qc echo /dev/null >/dev/null 2>&1; then
faketty() { script -qec "$*" /dev/null; }
@@ -502,17 +510,25 @@ if command -v script >/dev/null 2>&1; then
sed 's/^\x5E\x44\x08\x08//'; }
fi
- faketty $JQ -n . > $d/color
+ faketty $JQ_NO_B -n . > $d/color
printf '\033[0;90mnull\033[0m\r\n' > $d/expect
+ od -c $d/expect
+ od -c $d/color
cmp $d/color $d/expect
- NO_COLOR= faketty $JQ -n . > $d/color
+ NO_COLOR= faketty $JQ_NO_B -n . > $d/color
printf '\033[0;90mnull\033[0m\r\n' > $d/expect
+ od -c $d/expect
+ od -c $d/color
cmp $d/color $d/expect
- NO_COLOR=1 faketty $JQ -n . > $d/color
+ NO_COLOR=1 faketty $JQ_NO_B -n . > $d/color
printf 'null\r\n' > $d/expect
+ od -c $d/expect
+ od -c $d/color
cmp $d/color $d/expect
- NO_COLOR=1 faketty $JQ -Cn . > $d/color
+ NO_COLOR=1 faketty $JQ_NO_B -Cn . > $d/color
printf '\033[0;90mnull\033[0m\r\n' > $d/expect
+ od -c $d/expect
+ od -c $d/color
cmp $d/color $d/expect
fi