diff options
author | William Deegan <bill@baddogconsulting.com> | 2019-08-24 23:47:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-24 23:47:36 (GMT) |
commit | ccee95d3f54d076b4d10aa56beb5608f2a92943a (patch) | |
tree | 27e4912c75630ef219797ac494b237bf70ff1ce9 /test | |
parent | d27caba743e47293ce82deb4a89e5b5d9904ce7b (diff) | |
parent | 3708316a79135e215a58e30b69b59222c123957b (diff) | |
download | SCons-ccee95d3f54d076b4d10aa56beb5608f2a92943a.zip SCons-ccee95d3f54d076b4d10aa56beb5608f2a92943a.tar.gz SCons-ccee95d3f54d076b4d10aa56beb5608f2a92943a.tar.bz2 |
Merge pull request #3413 from mwichmann/ci-vs2019
Add VS2019 to appveyor matrix
Diffstat (limited to 'test')
-rw-r--r-- | test/TaskMaster/bug_2811/fixture_dir/SConstruct | 10 | ||||
-rw-r--r-- | test/TaskMaster/bug_2811/fixture_dir/mycopy.py | 8 | ||||
-rw-r--r-- | test/packaging/guess-package-name.py | 22 | ||||
-rw-r--r-- | test/packaging/tar/bz2_packaging.py | 16 | ||||
-rw-r--r-- | test/packaging/tar/xz_packaging.py | 3 |
5 files changed, 47 insertions, 12 deletions
diff --git a/test/TaskMaster/bug_2811/fixture_dir/SConstruct b/test/TaskMaster/bug_2811/fixture_dir/SConstruct index c124902..d453368 100644 --- a/test/TaskMaster/bug_2811/fixture_dir/SConstruct +++ b/test/TaskMaster/bug_2811/fixture_dir/SConstruct @@ -10,6 +10,7 @@ This issue requires the following. Nth target's implicit lists changing when compared to SConsign's which have been loaded. 7. This forces rebuild of source file and this propagates to massive recompile """ +import sys import SCons.Tool @@ -27,12 +28,15 @@ def _dwo_emitter(target, source, env): targets = target + new_targets return (targets, source) +build_string = '$MYCOPY $SOURCE $TARGET' -bld = Builder(action='cp $SOURCE $TARGET') -env = Environment(BUILDERS={'Foo': bld}) +bld = Builder(action=build_string) + +env = Environment(BUILDERS={'Foo': bld}, MYCOPY="%s mycopy.py"%sys.executable) + +env['SHCCCOM'] = '$MYCOPY $SOURCE $TARGET && $MYCOPY $SOURCE ${TARGETS[1]}' -env['SHCCCOM'] = 'cp $SOURCE $TARGET && cp $SOURCE ${TARGETS[1]}' env['SHCCCOMSTR'] = env['SHCCCOM'] diff --git a/test/TaskMaster/bug_2811/fixture_dir/mycopy.py b/test/TaskMaster/bug_2811/fixture_dir/mycopy.py new file mode 100644 index 0000000..c1a57f5 --- /dev/null +++ b/test/TaskMaster/bug_2811/fixture_dir/mycopy.py @@ -0,0 +1,8 @@ +import sys +import shutil + +ffrom = sys.argv[1] +to = sys.argv[2] +shutil.copyfile(ffrom, to) + +sys.exit(0) diff --git a/test/packaging/guess-package-name.py b/test/packaging/guess-package-name.py index 8ba4c9e..1786c11 100644 --- a/test/packaging/guess-package-name.py +++ b/test/packaging/guess-package-name.py @@ -33,6 +33,8 @@ Also overriding this default package name is tested Furthermore that targz is the default packager is tested. """ +import sys + import TestSCons python = TestSCons.python @@ -88,8 +90,12 @@ test.must_exist('src.tar.gz') # # TEST: default package name creation with overridden packager. # +# 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. As a hack, just skip. -test.write('SConstruct', """ +if sys.platform != 'win32': + test.write('SConstruct', """ env=Environment(tools=['default', 'packaging']) env.Program( 'src/main.c' ) env.Package( NAME = 'libfoo', @@ -98,15 +104,19 @@ env.Package( NAME = 'libfoo', source = [ 'src/main.c', 'SConstruct' ] ) """) -test.run(stderr=None) + test.run(stderr=None) -test.must_exist('libfoo-1.2.3.tar.bz2') + test.must_exist('libfoo-1.2.3.tar.bz2') # # TEST: default package name creation with another packager. # +# Windows 10 since at least 1803 supplies bsdtar, so tool +# detection will find it - but it doesn't support xz +# compression so test using it will fail. As a hack, just skip. -test.write('SConstruct', """ +if sys.platform != 'win32': + test.write('SConstruct', """ env=Environment(tools=['default', 'packaging']) env.Program( 'src/main.c' ) env.Package( NAME = 'libfoo', @@ -115,9 +125,9 @@ env.Package( NAME = 'libfoo', source = [ 'src/main.c', 'SConstruct' ] ) """) -test.run(stderr=None) + test.run(stderr=None) -test.must_exist('libfoo-1.2.3.tar.xz') + test.must_exist('libfoo-1.2.3.tar.xz') test.pass_test() diff --git a/test/packaging/tar/bz2_packaging.py b/test/packaging/tar/bz2_packaging.py index 875f1c9..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,9 +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') +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 f12292e..1d80f7f 100644 --- a/test/packaging/tar/xz_packaging.py +++ b/test/packaging/tar/xz_packaging.py @@ -39,6 +39,9 @@ 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') |