fix testWrap: revert experimental changes
parent
081d642365
commit
cf51c85391
|
@ -167,7 +167,7 @@ void Module::parseMarkup(const std::string& data) {
|
||||||
[assign_a(cls,cls0)] // also clear class to avoid partial parse
|
[assign_a(cls,cls0)] // also clear class to avoid partial parse
|
||||||
[assign_a(fwDec, fwDec0)];
|
[assign_a(fwDec, fwDec0)];
|
||||||
|
|
||||||
Rule module_content_p = basic.comments_p | class_p
|
Rule module_content_p = basic.comments_p | include_p | class_p
|
||||||
| templateSingleInstantiation_p | forward_declaration_p
|
| templateSingleInstantiation_p | forward_declaration_p
|
||||||
| global_function_g | namespace_def_p;
|
| global_function_g | namespace_def_p;
|
||||||
|
|
||||||
|
@ -530,8 +530,7 @@ void Module::python_wrapper(const string& toolboxPath) const {
|
||||||
wrapperFile.oss << "{\n";
|
wrapperFile.oss << "{\n";
|
||||||
|
|
||||||
// write out classes
|
// write out classes
|
||||||
for(const Class& cls: classes) {
|
for(const Class& cls: expandedClasses) {
|
||||||
cout << "tmpl args:" << cls.templateArgs.size() << endl;
|
|
||||||
cls.python_wrapper(wrapperFile);
|
cls.python_wrapper(wrapperFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ virtual class ns::OtherClass;
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
#include <gtsam/geometry/Point2.h>
|
|
||||||
class Point2 {
|
class Point2 {
|
||||||
Point2();
|
Point2();
|
||||||
Point2(double x, double y);
|
Point2(double x, double y);
|
||||||
|
@ -21,7 +20,6 @@ class Point2 {
|
||||||
void serializable() const; // Sets flag and creates export, but does not make serialization functions
|
void serializable() const; // Sets flag and creates export, but does not make serialization functions
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <gtsam/geometry/Point3.h>
|
|
||||||
class Point3 {
|
class Point3 {
|
||||||
Point3(double x, double y, double z);
|
Point3(double x, double y, double z);
|
||||||
double norm() const;
|
double norm() const;
|
||||||
|
|
|
@ -477,26 +477,6 @@ TEST( wrap, python_code_geometry ) {
|
||||||
EXPECT(files_equal(epath + "geometry_python.cpp", apath + "geometry_python.cpp" ));
|
EXPECT(files_equal(epath + "geometry_python.cpp", apath + "geometry_python.cpp" ));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
|
||||||
TEST( wrap, cython_code_geometry ) {
|
|
||||||
// Parse into class object
|
|
||||||
string header_path = topdir + "/wrap/tests";
|
|
||||||
Module module(header_path,"geometry",enable_verbose);
|
|
||||||
string path = topdir + "/wrap";
|
|
||||||
|
|
||||||
// clean out previous generated code
|
|
||||||
fs::remove_all("actual-cython");
|
|
||||||
|
|
||||||
// emit MATLAB code
|
|
||||||
// make_geometry will not compile, use make testwrap to generate real make
|
|
||||||
module.cython_wrapper("actual-cython");
|
|
||||||
string epath = path + "/tests/expected-cython/";
|
|
||||||
string apath = "actual-cython/";
|
|
||||||
|
|
||||||
EXPECT(files_equal(epath + "geometry_cython.pxd", apath + "geometry_cython.pxd" ));
|
|
||||||
EXPECT(files_equal(epath + "geometry.pyx", apath + "geometry.pyx" ));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
int main() { TestResult tr; return TestRegistry::runAllTests(tr); }
|
int main() { TestResult tr; return TestRegistry::runAllTests(tr); }
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
Loading…
Reference in New Issue