changeset 42:4c8334b0ab30

switched scons tests=1 to build unittest++ tests instead of boost ones. Tests kept in separate executables to make it work in the same way as with old tests (integrated part of test_fife unit testing script). Audio tests shortened.
author jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
date Sun, 13 Jul 2008 07:43:33 +0000
parents b661ba234c3b
children 6daa907234e1
files tests/core_tests/SConscript tests/core_tests/main.cpp tests/core_tests/test_dat1++.cpp tests/core_tests/test_dat2++.cpp tests/core_tests/test_gui++.cpp tests/core_tests/test_imagepool++.cpp tests/core_tests/test_images++.cpp tests/core_tests/test_rect++.cpp tests/core_tests/test_vfs++.cpp tests/core_tests/test_zip++.cpp tests/swig_tests/audio_tests.py
diffstat 11 files changed, 42 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/tests/core_tests/SConscript	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/core_tests/SConscript	Sun Jul 13 07:43:33 2008 +0000
@@ -6,7 +6,7 @@
 env.Append(CPPPATH = ['#/engine/core'])
 env.Append(LIBPATH = ['#/engine/core'])
 
-env.Append(LIBS = ['libfife','boost_unit_test_framework'])
+env.Append(LIBS = ['libfife','libUnitTest++'])
 
 if sys.platform == 'darwin':
 	env.Append(LIBPATH = ['/System/Library'])
@@ -17,18 +17,18 @@
 else:
         env.Append(LINKFLAGS=['-Wl,-rpath,../../ext/install/lib,-rpath,../../engine'])
 
-# The test_all.py script relies on this specific layout.
+# The test_fife.py script relies on this specific layout.
 # Check it, if you change something here
-env.Program('testprog_rect', ['test_rect.cpp'])
-env.Program('testprog_dat1', ['test_dat1.cpp'])
-env.Program('testprog_dat2', ['test_dat2.cpp'])
-env.Program('testprog_gui', ['test_gui.cpp'])
-env.Program('testprog_images', ['test_images.cpp'])
-env.Program('testprog_imagepool', ['test_imagepool.cpp'])
-env.Program('testprog_vfs', ['test_vfs.cpp'])
+env.Program('testprog_rect', ['test_rect++.cpp'])
+env.Program('testprog_dat1', ['test_dat1++.cpp'])
+env.Program('testprog_dat2', ['test_dat2++.cpp'])
+env.Program('testprog_gui', ['test_gui++.cpp'])
+env.Program('testprog_images', ['test_images++.cpp'])
+env.Program('testprog_imagepool', ['test_imagepool++.cpp'])
+env.Program('testprog_vfs', ['test_vfs++.cpp'])
 
 
 if env['zip']:
-	env.Program('testprog_zip', ['test_zip.cpp'])
+	env.Program('testprog_zip', ['test_zip++.cpp'])
 
 # vim: set filetype=python :
--- a/tests/core_tests/main.cpp	Sat Jul 12 14:45:59 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2008 by the FIFE team                              *
- *   http://www.fifengine.de                                               *
- *   This file is part of FIFE.                                            *
- *                                                                         *
- *   FIFE is free software; you can redistribute it and/or modify          *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
- ***************************************************************************/
-
-// Standard C++ library includes
-
-// Platform specific includes
-#include "fife_unittest++.h"
-
-// 3rd party library includes
-
-// FIFE includes
-// These includes are split up in two parts, separated by one empty line
-// First block: files included from the FIFE root src directory
-// Second block: files included from the same folder
-
-int main(){
-	return UnitTest::RunAllTests();
-}
--- a/tests/core_tests/test_dat1++.cpp	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/core_tests/test_dat1++.cpp	Sun Jul 13 07:43:33 2008 +0000
@@ -89,5 +89,8 @@
 	delete[] d_comp;
 	delete fraw;
 	delete fcomp;
+}
 
+int main() {
+	return UnitTest::RunAllTests();
 }
--- a/tests/core_tests/test_dat2++.cpp	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/core_tests/test_dat2++.cpp	Sun Jul 13 07:43:33 2008 +0000
@@ -99,3 +99,7 @@
 	delete fcomp;
 
 }
+
+int main() {
+	return UnitTest::RunAllTests();
+}
--- a/tests/core_tests/test_gui++.cpp	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/core_tests/test_gui++.cpp	Sun Jul 13 07:43:33 2008 +0000
@@ -128,3 +128,7 @@
 	OpenGLGuiGraphics graphics(pool);
 	test_gui_image(renderbackend, graphics, pool);
 }
+
+int main() {
+	return UnitTest::RunAllTests();
+}
--- a/tests/core_tests/test_imagepool++.cpp	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/core_tests/test_imagepool++.cpp	Sun Jul 13 07:43:33 2008 +0000
@@ -131,3 +131,7 @@
 	CHECK_EQUAL(0, pool.getResourceCount(RES_LOADED));
 	CHECK_EQUAL(0, pool.getResourceCount(RES_NON_LOADED));
 }
+
+int main() {
+	return UnitTest::RunAllTests();
+}
--- a/tests/core_tests/test_images++.cpp	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/core_tests/test_images++.cpp	Sun Jul 13 07:43:33 2008 +0000
@@ -196,3 +196,6 @@
 	test_subimage(env.vfs.get(), renderbackend);
 }
 
+int main() {
+	return UnitTest::RunAllTests();
+}
--- a/tests/core_tests/test_rect++.cpp	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/core_tests/test_rect++.cpp	Sun Jul 13 07:43:33 2008 +0000
@@ -82,3 +82,7 @@
 		CHECK(!dont_intersect[i].intersects(a));
 	}	
 }
+
+int main() {
+	return UnitTest::RunAllTests();
+}
--- a/tests/core_tests/test_vfs++.cpp	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/core_tests/test_vfs++.cpp	Sun Jul 13 07:43:33 2008 +0000
@@ -67,3 +67,7 @@
 	CHECK(vfs->isDirectory(FIFE_TEST_DIR+"/"+FIFE_TEST_DIR));
 
 }
+
+int main() {
+	return UnitTest::RunAllTests();
+}
--- a/tests/core_tests/test_zip++.cpp	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/core_tests/test_zip++.cpp	Sun Jul 13 07:43:33 2008 +0000
@@ -114,3 +114,7 @@
 	delete fraw;
 	delete fcomp;
 }
+
+int main() {
+	return UnitTest::RunAllTests();
+}
--- a/tests/swig_tests/audio_tests.py	Sat Jul 12 14:45:59 2008 +0000
+++ b/tests/swig_tests/audio_tests.py	Sun Jul 13 07:43:33 2008 +0000
@@ -21,7 +21,7 @@
 		sound.setSoundClip(id)
 		sound.setLooping(True)
 		sound.play()
-		time.sleep(15);
+		time.sleep(3);
 	
 	def test2Streams(self):
 		em = self.soundmanager.createEmitter()
@@ -34,7 +34,7 @@
 		em.setGain(0.7)
 		em.play()
 		sound.play()
-		time.sleep(15);
+		time.sleep(3);
 
 TEST_CLASSES = [TestAudio]