From 5c80940361e30b354917b26d8ba68ea1b9d13f23 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 7 Aug 2019 14:06:02 -0600 Subject: skip certain tar-pkg tests on win32 [travis skip] Signed-off-by: Mats Wichmann --- test/packaging/guess-package-name.py | 5 ++--- test/packaging/tar/bz2_packaging.py | 19 +++++++++++++------ test/packaging/tar/xz_packaging.py | 10 +++++----- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/test/packaging/guess-package-name.py b/test/packaging/guess-package-name.py index fa69595..1786c11 100644 --- a/test/packaging/guess-package-name.py +++ b/test/packaging/guess-package-name.py @@ -92,10 +92,9 @@ test.must_exist('src.tar.gz') # # Windows 10 since at least 1803 supplies bsdtar, so tool # detection will find it - but doesn't supply bzip2, so a -# test using it will fail. Check for bzip2 first. +# test using it will fail. As a hack, just skip. -bz2 = test.where_is('bzip2') -if bz2: +if sys.platform != 'win32': test.write('SConstruct', """ env=Environment(tools=['default', 'packaging']) env.Program( 'src/main.c' ) diff --git a/test/packaging/tar/bz2_packaging.py b/test/packaging/tar/bz2_packaging.py index 9026eb0..812c08e 100644 --- a/test/packaging/tar/bz2_packaging.py +++ b/test/packaging/tar/bz2_packaging.py @@ -31,6 +31,9 @@ This tests the SRC bz2 packager, which does the following: import TestSCons +import os +import sys + python = TestSCons.python test = TestSCons.TestSCons() @@ -39,12 +42,16 @@ tar = test.detect('TAR', 'tar') if not tar: test.skip_test('tar not found, skipping test\n') -bz2 = test.where_is('bzip2') -#if not bz2: -# test.skip_test('tar found, but helper bzip2 not found, skipping test\n') - -tar = test.where_is('tar') -test.skip_test('DEBUG: found TAR at %s, BZIP2 at %s\n' % (tar, bz2)) +if sys.platform == 'win32': + # windows 10 causes fresh problems by supplying a tar, not bzip2 + # but if git is installed, there's a bzip2 there, but can't be used + bz2 = test.where_is('bzip2') + if not bz2: + test.skip_test('tar found, but helper bzip2 not found, skipping test\n') + bz2 = os.path.splitdrive(bz2)[1] + tar = os.path.splitdrive(test.where_is('tar'))[1] + if tar[:8] != bz2[:8]: # catch one in \WINDOWS, one not + test.skip_test('tar found, but usable bzip2 not, skipping test\n') test.subdir('src') diff --git a/test/packaging/tar/xz_packaging.py b/test/packaging/tar/xz_packaging.py index 62ca8bf..1d80f7f 100644 --- a/test/packaging/tar/xz_packaging.py +++ b/test/packaging/tar/xz_packaging.py @@ -39,12 +39,12 @@ tar = test.detect('TAR', 'tar') if not tar: test.skip_test('tar not found, skipping test\n') +# Windows 10 now supplies tar, but doesn't support xz compression +# assume it's just okay to check for an xz command, because don't +# want to probe the command itself to see what it supports xz = test.where_is('xz') -#if not xz: -# test.skip_test('tar found, but helper xz not found, skipping test\n') - -tar = test.where_is('tar') -test.skip_test('DEBUG: found TAR at %s, XZ at %s\n' % (tar, xz)) +if not xz: + test.skip_test('tar found, but helper xz not found, skipping test\n') test.subdir('src') -- cgit v0.12