Skip to content

Commit 33eacd3

Browse files
committed
Merge branch 'jk/tzoffset-fix' into maint
Skip tests that are unrunnable on platforms without 64-bit long to avoid unnecessary test failures. * jk/tzoffset-fix: t0006: skip "far in the future" test when unsigned long is not long enough
2 parents 5c9159d + 6b9c38e commit 33eacd3

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

help.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ int cmd_version(int argc, const char **argv, const char *prefix)
419419
* with external projects that rely on the output of "git version".
420420
*/
421421
printf("git version %s\n", git_version_string);
422+
while (*++argv) {
423+
if (!strcmp(*argv, "--build-options")) {
424+
printf("sizeof-long: %d\n", (int)sizeof(long));
425+
/* NEEDSWORK: also save and output GIT-BUILD_OPTIONS? */
426+
}
427+
}
422428
return 0;
423429
}
424430

t/t0006-date.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ check_show () {
3131
format=$1
3232
time=$2
3333
expect=$3
34-
test_expect_${4:-success} "show date ($format:$time)" '
34+
test_expect_success $4 "show date ($format:$time)" '
3535
echo "$time -> $expect" >expect &&
3636
test-date show:$format "$time" >actual &&
3737
test_cmp expect actual
@@ -50,8 +50,8 @@ check_show iso-local "$TIME" '2016-06-15 14:13:20 +0000'
5050

5151
# arbitrary time absurdly far in the future
5252
FUTURE="5758122296 -0400"
53-
check_show iso "$FUTURE" "2152-06-19 18:24:56 -0400"
54-
check_show iso-local "$FUTURE" "2152-06-19 22:24:56 +0000"
53+
check_show iso "$FUTURE" "2152-06-19 18:24:56 -0400" LONG_IS_64BIT
54+
check_show iso-local "$FUTURE" "2152-06-19 22:24:56 +0000" LONG_IS_64BIT
5555

5656
check_parse() {
5757
echo "$1 -> $2" >expect

t/test-lib.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,3 +1111,12 @@ run_with_limited_cmdline () {
11111111
}
11121112

11131113
test_lazy_prereq CMDLINE_LIMIT 'run_with_limited_cmdline true'
1114+
1115+
build_option () {
1116+
git version --build-options |
1117+
sed -ne "s/^$1: //p"
1118+
}
1119+
1120+
test_lazy_prereq LONG_IS_64BIT '
1121+
test 8 -le "$(build_option sizeof-long)"
1122+
'

0 commit comments

Comments
 (0)