diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-08-28 23:02:10 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-08-28 23:02:10 (GMT) |
commit | b735a9289ae90b3284da18433f0348bab1636fd0 (patch) | |
tree | 0aa599622caf7370998cc596cf4a7377b6d8aa83 /test/packaging | |
parent | e3e353343c926d288214057d29c2461fbcf4d4f8 (diff) | |
parent | c5f2f746e26c77190109eb4e23c1f18779e27528 (diff) | |
download | SCons-b735a9289ae90b3284da18433f0348bab1636fd0.zip SCons-b735a9289ae90b3284da18433f0348bab1636fd0.tar.gz SCons-b735a9289ae90b3284da18433f0348bab1636fd0.tar.bz2 |
Merging pull request #33, test framework, from Dirk Baechle.
Diffstat (limited to 'test/packaging')
-rw-r--r-- | test/packaging/convenience-functions/convenience-functions.py (renamed from test/packaging/convenience-functions.py) | 17 | ||||
-rw-r--r-- | test/packaging/convenience-functions/image/SConstruct | 10 | ||||
-rw-r--r-- | test/packaging/convenience-functions/image/f1 | 0 | ||||
-rw-r--r-- | test/packaging/convenience-functions/image/f2 | 0 | ||||
-rw-r--r-- | test/packaging/convenience-functions/image/f3 | 0 | ||||
-rw-r--r-- | test/packaging/sandbox-test/SConstruct | 19 | ||||
-rw-r--r-- | test/packaging/sandbox-test/sandbox-test.py (renamed from test/packaging/sandbox-test.py) | 27 | ||||
-rw-r--r-- | test/packaging/sandbox-test/src/foobar.c | 0 | ||||
-rw-r--r-- | test/packaging/sandbox-test/src/foobar.h | 0 |
9 files changed, 32 insertions, 41 deletions
diff --git a/test/packaging/convenience-functions.py b/test/packaging/convenience-functions/convenience-functions.py index 2fc6aee..a1be041 100644 --- a/test/packaging/convenience-functions.py +++ b/test/packaging/convenience-functions/convenience-functions.py @@ -31,24 +31,9 @@ Test the FindInstalledFiles() and the FindSourceFiles() functions. import os.path import TestSCons -python = TestSCons.python test = TestSCons.TestSCons() -test.write( "f1", "" ) -test.write( "f2", "" ) -test.write( "f3", "" ) - -test.write( 'SConstruct', r""" -env = Environment(tools=['default', 'packaging']) -prog = env.Install( 'bin/', ["f1", "f2"] ) -env.File( "f3" ) - -src_files = sorted(map(str, env.FindSourceFiles())) -oth_files = sorted(map(str, env.FindInstalledFiles())) - -print src_files -print oth_files -""") +test.dir_fixture( "image" ) bin_f1 = os.path.join('bin', 'f1') bin_f2 = os.path.join('bin', 'f2') diff --git a/test/packaging/convenience-functions/image/SConstruct b/test/packaging/convenience-functions/image/SConstruct new file mode 100644 index 0000000..461961e --- /dev/null +++ b/test/packaging/convenience-functions/image/SConstruct @@ -0,0 +1,10 @@ + +env = Environment(tools=['default', 'packaging']) +prog = env.Install( 'bin/', ["f1", "f2"] ) +env.File( "f3" ) + +src_files = sorted(map(str, env.FindSourceFiles())) +oth_files = sorted(map(str, env.FindInstalledFiles())) + +print src_files +print oth_files diff --git a/test/packaging/convenience-functions/image/f1 b/test/packaging/convenience-functions/image/f1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/packaging/convenience-functions/image/f1 diff --git a/test/packaging/convenience-functions/image/f2 b/test/packaging/convenience-functions/image/f2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/packaging/convenience-functions/image/f2 diff --git a/test/packaging/convenience-functions/image/f3 b/test/packaging/convenience-functions/image/f3 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/packaging/convenience-functions/image/f3 diff --git a/test/packaging/sandbox-test/SConstruct b/test/packaging/sandbox-test/SConstruct new file mode 100644 index 0000000..f44a471 --- /dev/null +++ b/test/packaging/sandbox-test/SConstruct @@ -0,0 +1,19 @@ + +from glob import glob + +src_files = glob( 'src/*.c' ) +include_files = glob( 'src/*.h' ) + +SharedLibrary( 'foobar', src_files ) + +env = Environment(tools=['default', 'packaging']) + +env.Package( NAME = 'libfoobar', + VERSION = '1.2.3', + PACKAGETYPE = 'targz', + source = src_files + include_files ) + +env.Package( NAME = 'libfoobar', + VERSION = '1.2.3', + PACKAGETYPE = 'zip', + source = src_files + include_files ) diff --git a/test/packaging/sandbox-test.py b/test/packaging/sandbox-test/sandbox-test.py index 7110c87..c6d2140 100644 --- a/test/packaging/sandbox-test.py +++ b/test/packaging/sandbox-test/sandbox-test.py @@ -39,31 +39,8 @@ tar = test.detect('TAR', 'tar') if not tar: test.skip_test('tar not found, skipping test\n') -test.subdir('src') - -test.write([ 'src', 'foobar.h' ], '') -test.write([ 'src', 'foobar.c' ], '') - -test.write('SConstruct', """ -from glob import glob - -src_files = glob( 'src/*.c' ) -include_files = glob( 'src/*.h' ) - -SharedLibrary( 'foobar', src_files ) - -env = Environment(tools=['default', 'packaging']) - -env.Package( NAME = 'libfoobar', - VERSION = '1.2.3', - PACKAGETYPE = 'targz', - source = src_files + include_files ) - -env.Package( NAME = 'libfoobar', - VERSION = '1.2.3', - PACKAGETYPE = 'zip', - source = src_files + include_files ) -""") +test.dir_fixture('src','src') +test.file_fixture('SConstruct') test.run(stderr=None) diff --git a/test/packaging/sandbox-test/src/foobar.c b/test/packaging/sandbox-test/src/foobar.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/packaging/sandbox-test/src/foobar.c diff --git a/test/packaging/sandbox-test/src/foobar.h b/test/packaging/sandbox-test/src/foobar.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/packaging/sandbox-test/src/foobar.h |