summaryrefslogtreecommitdiffstats
path: root/test/packaging
diff options
context:
space:
mode:
authordirkbaechle <devnull@localhost>2012-08-12 13:06:36 (GMT)
committerdirkbaechle <devnull@localhost>2012-08-12 13:06:36 (GMT)
commit4ae583161be1735d0450be17fe2383ec5c4f475e (patch)
tree70d51a5b45a13ff964e8dad6a9a423c0b341c68c /test/packaging
parent780d9ca6577e5a15b4d4cfad111b74132c255be1 (diff)
downloadSCons-4ae583161be1735d0450be17fe2383ec5c4f475e.zip
SCons-4ae583161be1735d0450be17fe2383ec5c4f475e.tar.gz
SCons-4ae583161be1735d0450be17fe2383ec5c4f475e.tar.bz2
- 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 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