summaryrefslogtreecommitdiff
path: root/test/packaging
diff options
context:
space:
mode:
authordirkbaechle <devnull@localhost>2012-08-12 15:06:36 +0200
committerdirkbaechle <devnull@localhost>2012-08-12 15:06:36 +0200
commit399855d910897c625a96103abd319c9bfc431d4d (patch)
tree70d51a5b45a13ff964e8dad6a9a423c0b341c68c /test/packaging
parente3315f2f0cf58faada5c8c6b42f03fefe0608ec8 (diff)
downloadscons-399855d910897c625a96103abd319c9bfc431d4d.tar.gz
- fixed directory/file fixtures for "general" mode
- added documentation for the testing framework - converted two old tests from the "packaging" section to using fixtures as reference examples
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/SConstruct10
-rw-r--r--test/packaging/convenience-functions/image/f10
-rw-r--r--test/packaging/convenience-functions/image/f20
-rw-r--r--test/packaging/convenience-functions/image/f30
-rw-r--r--test/packaging/sandbox-test/SConstruct19
-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.c0
-rw-r--r--test/packaging/sandbox-test/src/foobar.h0
9 files changed, 32 insertions, 41 deletions
diff --git a/test/packaging/convenience-functions.py b/test/packaging/convenience-functions/convenience-functions.py
index 2fc6aeea..a1be0412 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 00000000..461961ed
--- /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 00000000..e69de29b
--- /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 00000000..e69de29b
--- /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 00000000..e69de29b
--- /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 00000000..f44a4710
--- /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 7110c875..c6d21408 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 00000000..e69de29b
--- /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 00000000..e69de29b
--- /dev/null
+++ b/test/packaging/sandbox-test/src/foobar.h