More portability.
- The location of openssl development files got customizable. - The location of iconv development files got customizable. - Pass $TAR down to t5000 test so that the user can override with 'gmake TAR=gtar'. - Solaris 'bc' does not seem to grok "define abs()". There is no reason to use bc there -- expr would do. Signed-off-by: Junio C Hamano <junio@twinsun.com>
This commit is contained in:
parent
8098a178b2
commit
455a7f3275
20
Makefile
20
Makefile
@ -200,18 +200,32 @@ endif
|
|||||||
ifndef NO_OPENSSL
|
ifndef NO_OPENSSL
|
||||||
LIB_OBJS += epoch.o
|
LIB_OBJS += epoch.o
|
||||||
OPENSSL_LIBSSL = -lssl
|
OPENSSL_LIBSSL = -lssl
|
||||||
|
ifdef OPENSSLDIR
|
||||||
|
# Again this may be problematic -- gcc does not always want -R.
|
||||||
|
CFLAGS += -I$(OPENSSLDIR)/include
|
||||||
|
OPENSSL_LINK = -L$(OPENSSLDIR)/lib -R$(OPENSSLDIR)/lib
|
||||||
|
else
|
||||||
|
OPENSSL_LINK =
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
DEFINES += '-DNO_OPENSSL'
|
DEFINES += '-DNO_OPENSSL'
|
||||||
MOZILLA_SHA1 = 1
|
MOZILLA_SHA1 = 1
|
||||||
OPENSSL_LIBSSL =
|
OPENSSL_LIBSSL =
|
||||||
endif
|
endif
|
||||||
ifdef NEEDS_SSL_WITH_CRYPTO
|
ifdef NEEDS_SSL_WITH_CRYPTO
|
||||||
LIB_4_CRYPTO = -lcrypto -lssl
|
LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
|
||||||
else
|
else
|
||||||
LIB_4_CRYPTO = -lcrypto
|
LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
|
||||||
endif
|
endif
|
||||||
ifdef NEEDS_LIBICONV
|
ifdef NEEDS_LIBICONV
|
||||||
LIB_4_ICONV = -liconv
|
ifdef ICONVDIR
|
||||||
|
# Again this may be problematic -- gcc does not always want -R.
|
||||||
|
CFLAGS += -I$(ICONVDIR)/include
|
||||||
|
ICONV_LINK = -L$(ICONVDIR)/lib -R$(ICONVDIR)/lib
|
||||||
|
else
|
||||||
|
ICONV_LINK =
|
||||||
|
endif
|
||||||
|
LIB_4_ICONV = $(ICONV_LINK) -liconv
|
||||||
else
|
else
|
||||||
LIB_4_ICONV =
|
LIB_4_ICONV =
|
||||||
endif
|
endif
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#GIT_TEST_OPTS=--verbose --debug
|
#GIT_TEST_OPTS=--verbose --debug
|
||||||
SHELL_PATH ?= $(SHELL)
|
SHELL_PATH ?= $(SHELL)
|
||||||
|
TAR ?= $(TAR)
|
||||||
|
|
||||||
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
|
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ test_expect_success \
|
|||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'validate file modification time' \
|
'validate file modification time' \
|
||||||
'TZ=GMT tar tvf b.tar a/a |
|
'TZ=GMT $TAR tvf b.tar a/a |
|
||||||
awk \{print\ \$4,\ \(length\(\$5\)\<7\)\ ?\ \$5\":00\"\ :\ \$5\} \
|
awk \{print\ \$4,\ \(length\(\$5\)\<7\)\ ?\ \$5\":00\"\ :\ \$5\} \
|
||||||
>b.mtime &&
|
>b.mtime &&
|
||||||
echo "2005-05-27 22:00:00" >expected.mtime &&
|
echo "2005-05-27 22:00:00" >expected.mtime &&
|
||||||
@ -63,7 +63,7 @@ test_expect_success \
|
|||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'extract tar archive' \
|
'extract tar archive' \
|
||||||
'(cd b && tar xf -) <b.tar'
|
'(cd b && $TAR xf -) <b.tar'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'validate filenames' \
|
'validate filenames' \
|
||||||
@ -80,7 +80,7 @@ test_expect_success \
|
|||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'extract tar archive with prefix' \
|
'extract tar archive with prefix' \
|
||||||
'(cd c && tar xf -) <c.tar'
|
'(cd c && $TAR xf -) <c.tar'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'validate filenames with prefix' \
|
'validate filenames with prefix' \
|
||||||
|
@ -7,20 +7,6 @@ test_description='Tests git-rev-list --bisect functionality'
|
|||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. ../t6000lib.sh # t6xxx specific functions
|
. ../t6000lib.sh # t6xxx specific functions
|
||||||
|
|
||||||
bc_expr()
|
|
||||||
{
|
|
||||||
bc <<EOF
|
|
||||||
scale=1
|
|
||||||
define abs(x) {
|
|
||||||
if (x>=0) { return (x); } else { return (-x); }
|
|
||||||
}
|
|
||||||
define floor(x) {
|
|
||||||
save=scale; scale=0; result=x/1; scale=save; return (result);
|
|
||||||
}
|
|
||||||
$*
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
# usage: test_bisection max-diff bisect-option head ^prune...
|
# usage: test_bisection max-diff bisect-option head ^prune...
|
||||||
#
|
#
|
||||||
# e.g. test_bisection 1 --bisect l1 ^l0
|
# e.g. test_bisection 1 --bisect l1 ^l0
|
||||||
@ -35,8 +21,19 @@ test_bisection_diff()
|
|||||||
_head=$1
|
_head=$1
|
||||||
shift 1
|
shift 1
|
||||||
_bisection_size=$(git-rev-list $_bisection "$@" | wc -l)
|
_bisection_size=$(git-rev-list $_bisection "$@" | wc -l)
|
||||||
[ -n "$_list_size" -a -n "$_bisection_size" ] || error "test_bisection_diff failed"
|
[ -n "$_list_size" -a -n "$_bisection_size" ] ||
|
||||||
test_expect_success "bisection diff $_bisect_option $_head $* <= $_max_diff" "[ $(bc_expr "floor(abs($_list_size/2)-$_bisection_size)") -le $_max_diff ]"
|
error "test_bisection_diff failed"
|
||||||
|
|
||||||
|
# Test if bisection size is close to half of list size within
|
||||||
|
# tolerance.
|
||||||
|
#
|
||||||
|
_bisect_err=`expr $_list_size - $_bisection_size \* 2`
|
||||||
|
test "$_bisect_err" -lt 0 && _bisect_err=`expr 0 - $_bisect_err`
|
||||||
|
_bisect_err=`expr $_bisect_err / 2` ; # floor
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
"bisection diff $_bisect_option $_head $* <= $_max_diff" \
|
||||||
|
'test $_bisect_err -le $_max_diff'
|
||||||
}
|
}
|
||||||
|
|
||||||
date >path0
|
date >path0
|
||||||
|
Loading…
Reference in New Issue
Block a user