[pygccxml-commit] SF.net SVN: pygccxml: [1182] pyplusplus_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2007-12-02 20:48:23
|
Revision: 1182
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1182&view=rev
Author: roman_yakovenko
Date: 2007-12-02 12:48:27 -0800 (Sun, 02 Dec 2007)
Log Message:
-----------
trying to create new tester that reproduce erronious generated code
Modified Paths:
--------------
pyplusplus_dev/unittests/data/split_module_bug_to_be_exported.hpp
pyplusplus_dev/unittests/split_module_bug_tester.py
Added Paths:
-----------
pyplusplus_dev/unittests/data/split_module_bug_to_be_exported.cpp
pyplusplus_dev/unittests/ogre_generate_tester.py
Added: pyplusplus_dev/unittests/data/split_module_bug_to_be_exported.cpp
===================================================================
--- pyplusplus_dev/unittests/data/split_module_bug_to_be_exported.cpp (rev 0)
+++ pyplusplus_dev/unittests/data/split_module_bug_to_be_exported.cpp 2007-12-02 20:48:27 UTC (rev 1182)
@@ -0,0 +1,3 @@
+#include "split_module_bug_to_be_exported.hpp"
+
+void do_smth(std::vector< image_t > &images){}
Modified: pyplusplus_dev/unittests/data/split_module_bug_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/split_module_bug_to_be_exported.hpp 2007-11-29 07:02:58 UTC (rev 1181)
+++ pyplusplus_dev/unittests/data/split_module_bug_to_be_exported.hpp 2007-12-02 20:48:27 UTC (rev 1182)
@@ -16,4 +16,10 @@
typedef std::vector<int> int_vector;
inline int_vector get_vector(){ return int_vector(); }
+struct image_t{
+ int i;
+};
+
+void do_smth(std::vector< image_t > &images);
+
#endif//__split_module_to_be_exported_hpp__
Added: pyplusplus_dev/unittests/ogre_generate_tester.py
===================================================================
--- pyplusplus_dev/unittests/ogre_generate_tester.py (rev 0)
+++ pyplusplus_dev/unittests/ogre_generate_tester.py 2007-12-02 20:48:27 UTC (rev 1182)
@@ -0,0 +1,50 @@
+# Copyright 2004 Roman Yakovenko.
+# Distributed under the Boost Software License, Version 1.0. (See
+# accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+import os
+import sys
+import shutil
+import unittest
+import autoconfig
+from pygccxml import parser
+from pygccxml import declarations
+from pyplusplus import code_creators
+from pyplusplus import module_creator
+from pyplusplus import module_builder
+from pyplusplus import utils as pypp_utils
+from pyplusplus import function_transformers as ft
+
+class ogre_generate_tester_t(unittest.TestCase):
+ def test(self):
+ ogre_file = autoconfig.data_directory.replace( 'pyplusplus_dev', 'pygccxml_dev' )
+ ogre_file = parser.create_gccxml_fc( os.path.join( ogre_file, 'ogre1.4.xml' ) )
+
+ mb = module_builder.module_builder_t(
+ [ ogre_file ]
+ , gccxml_path=autoconfig.gccxml.executable
+ , indexing_suite_version=2)
+ mb.global_ns.exclude()
+ mb.namespace('Ogre').include()
+
+ target_dir = os.path.join( autoconfig.build_directory, 'ogre' )
+ if os.path.exists( target_dir ):
+ shutil.rmtree( target_dir )
+ os.mkdir( target_dir )
+
+ mb.build_code_creator( 'Ogre3d' )
+ mb.split_module( target_dir )
+
+
+
+def create_suite():
+ suite = unittest.TestSuite()
+ suite.addTest( unittest.makeSuite(ogre_generate_tester_t))
+ return suite
+
+def run_suite():
+ unittest.TextTestRunner(verbosity=2).run( create_suite() )
+
+if __name__ == "__main__":
+ run_suite()
Modified: pyplusplus_dev/unittests/split_module_bug_tester.py
===================================================================
--- pyplusplus_dev/unittests/split_module_bug_tester.py 2007-11-29 07:02:58 UTC (rev 1181)
+++ pyplusplus_dev/unittests/split_module_bug_tester.py 2007-12-02 20:48:27 UTC (rev 1182)
@@ -19,6 +19,7 @@
fundamental_tester_base.fundamental_tester_base_t.__init__(
self
, tester_t.EXTENSION_NAME
+ , indexing_suite_version=2
, *args )
self.files = []
@@ -30,8 +31,11 @@
def generate_source_files( self, mb ):
files = mb.split_module( autoconfig.build_dir, on_unused_file_found=lambda fpath: fpath )
self.files = filter( lambda fname: fname.endswith( 'cpp' ), files )
+ self.files.append( os.path.join( autoconfig.data_directory
+ , self.EXTENSION_NAME + '_to_be_exported.cpp' ) )
print self.files
+
def get_source_files( self ):
return self.files
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|