components/xz/patches/system-test.patch
changeset 4762 4d5e4d2893b8
equal deleted inserted replaced
4761:0904e6cd33e4 4762:4d5e4d2893b8
       
     1 Patches to allow us to specify alternate locations for various xz scripts
       
     2 when running tests
       
     3 
       
     4 This patch should be sent upstream.
       
     5 
       
     6 --- xz-5.2.1/tests/test_compress.sh.orig	2015-08-10 05:34:11.999000878 -0700
       
     7 +++ xz-5.2.1/tests/test_compress.sh	2015-08-10 05:49:30.044238292 -0700
       
     8 @@ -9,13 +9,15 @@
       
     9  #
       
    10  ###############################################################################
       
    11  
       
    12 -# If xz wasn't built, this test is skipped.
       
    13 -if test -x ../src/xz/xz ; then
       
    14 -	:
       
    15 -else
       
    16 +# If the xz script isn't found, this test is skipped.
       
    17 +XZ_PROG="${XZ_SCRIPT:-../src/xz/xz}"
       
    18 +XZDEC_PROG="${XZDEC_SCRIPT:-../src/xzdec/xzdec}"
       
    19 +
       
    20 +for i in XZ_PROG XZDEC_PROG; do
       
    21 +	eval test -x "\$$i" && continue
       
    22  	(exit 77)
       
    23  	exit 77
       
    24 -fi
       
    25 +done
       
    26  
       
    27  # Find out if our shell supports functions.
       
    28  eval 'unset foo ; foo() { return 42; } ; foo'
       
    29 @@ -74,10 +76,10 @@
       
    30  	echo . | tr -d '\n\r'
       
    31  }
       
    32  
       
    33 -XZ="../src/xz/xz --memlimit-compress=48MiB --memlimit-decompress=5MiB \
       
    34 +XZ="$XZ_PROG --memlimit-compress=48MiB --memlimit-decompress=5MiB \
       
    35  		--no-adjust --threads=1 --check=crc64"
       
    36 -XZDEC="../src/xzdec/xzdec" # No memory usage limiter available
       
    37 -test -x ../src/xzdec/xzdec || XZDEC=
       
    38 +XZDEC="$XZDEC_PROG" # No memory usage limiter available
       
    39 +test -x $XZDEC_PROG || XZDEC=
       
    40  
       
    41  # Create the required input files.
       
    42  if ./create_compress_files ; then
       
    43 --- xz-5.2.1/tests/test_files.sh.orig	2015-08-10 05:33:23.741544673 -0700
       
    44 +++ xz-5.2.1/tests/test_files.sh	2015-08-10 05:46:25.045018366 -0700
       
    45 @@ -9,15 +9,15 @@
       
    46  #
       
    47  ###############################################################################
       
    48  
       
    49 -# If both xz and xzdec were not build, skip this test.
       
    50 -XZ=../src/xz/xz
       
    51 -XZDEC=../src/xzdec/xzdec
       
    52 -test -x "$XZ" || XZ=
       
    53 -test -x "$XZDEC" || XZDEC=
       
    54 -if test -z "$XZ$XZDEC"; then
       
    55 +# If both xz and xzdec are not found, skip this test.
       
    56 +XZ="${XZ_SCRIPT:-../src/xz/xz}"
       
    57 +XZDEC="${XZDEC_SCRIPT:-../src/xzdec/xzdec}"
       
    58 +
       
    59 +for i in XZ XZDEC; do
       
    60 +	eval test -x "\$$i" && continue
       
    61  	(exit 77)
       
    62  	exit 77
       
    63 -fi
       
    64 +done
       
    65  
       
    66  for I in "$srcdir"/files/good-*.xz
       
    67  do
       
    68 --- xz-5.2.1/tests/test_scripts.sh.orig	2015-08-10 05:35:11.436118619 -0700
       
    69 +++ xz-5.2.1/tests/test_scripts.sh	2015-08-10 05:38:39.611332394 -0700
       
    70 @@ -9,10 +9,10 @@
       
    71  #
       
    72  ###############################################################################
       
    73  
       
    74 -# If scripts weren't built, this test is skipped.
       
    75 -XZ=../src/xz/xz
       
    76 -XZDIFF=../src/scripts/xzdiff
       
    77 -XZGREP=../src/scripts/xzgrep
       
    78 +# If scripts not found, this test is skipped.
       
    79 +XZ="${XZ_SCRIPT:-../src/xz/xz}"
       
    80 +XZDIFF="${XZDIFF_SCRIPT:-../src/scripts/xzdiff}"
       
    81 +XZGREP="${XZGREP_SCRIPT:-../src/scripts/xzgrep}"
       
    82  
       
    83  for i in XZ XZDIFF XZGREP; do
       
    84  	eval test -x "\$$i" && continue