Updated wrap unit tests for new wrap changes
parent
b33713a02e
commit
7ba7aa6cfc
|
@ -2,82 +2,83 @@
|
||||||
|
|
||||||
MEX = mex
|
MEX = mex
|
||||||
MEXENDING = mexa64
|
MEXENDING = mexa64
|
||||||
|
PATH_TO_WRAP = /not_really_a_real_path/borg/gtsam/wrap
|
||||||
mex_flags = -O5
|
mex_flags = -O5
|
||||||
|
|
||||||
all: Point2 Point3 Test
|
all: Point2 Point3 Test
|
||||||
|
|
||||||
# Point2
|
# Point2
|
||||||
new_Point2_.$(MEXENDING): new_Point2_.cpp
|
new_Point2_.$(MEXENDING): new_Point2_.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) new_Point2_.cpp -output new_Point2_
|
$(MEX) $(mex_flags) new_Point2_.cpp -output new_Point2_
|
||||||
@Point2/x.$(MEXENDING): @Point2/x.cpp
|
@Point2/x.$(MEXENDING): @Point2/x.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Point2/x.cpp -output @Point2/x
|
$(MEX) $(mex_flags) @Point2/x.cpp -output @Point2/x
|
||||||
@Point2/y.$(MEXENDING): @Point2/y.cpp
|
@Point2/y.$(MEXENDING): @Point2/y.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Point2/y.cpp -output @Point2/y
|
$(MEX) $(mex_flags) @Point2/y.cpp -output @Point2/y
|
||||||
@Point2/dim.$(MEXENDING): @Point2/dim.cpp
|
@Point2/dim.$(MEXENDING): @Point2/dim.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Point2/dim.cpp -output @Point2/dim
|
$(MEX) $(mex_flags) @Point2/dim.cpp -output @Point2/dim
|
||||||
@Point2/returnChar.$(MEXENDING): @Point2/returnChar.cpp
|
@Point2/returnChar.$(MEXENDING): @Point2/returnChar.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Point2/returnChar.cpp -output @Point2/returnChar
|
$(MEX) $(mex_flags) @Point2/returnChar.cpp -output @Point2/returnChar
|
||||||
@Point2/argChar.$(MEXENDING): @Point2/argChar.cpp
|
@Point2/argChar.$(MEXENDING): @Point2/argChar.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Point2/argChar.cpp -output @Point2/argChar
|
$(MEX) $(mex_flags) @Point2/argChar.cpp -output @Point2/argChar
|
||||||
@Point2/argUChar.$(MEXENDING): @Point2/argUChar.cpp
|
@Point2/argUChar.$(MEXENDING): @Point2/argUChar.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Point2/argUChar.cpp -output @Point2/argUChar
|
$(MEX) $(mex_flags) @Point2/argUChar.cpp -output @Point2/argUChar
|
||||||
@Point2/vectorConfusion.$(MEXENDING): @Point2/vectorConfusion.cpp
|
@Point2/vectorConfusion.$(MEXENDING): @Point2/vectorConfusion.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Point2/vectorConfusion.cpp -output @Point2/vectorConfusion
|
$(MEX) $(mex_flags) @Point2/vectorConfusion.cpp -output @Point2/vectorConfusion
|
||||||
|
|
||||||
Point2: new_Point2_.$(MEXENDING) @Point2/x.$(MEXENDING) @Point2/y.$(MEXENDING) @Point2/dim.$(MEXENDING) @Point2/returnChar.$(MEXENDING) @Point2/argChar.$(MEXENDING) @Point2/argUChar.$(MEXENDING) @Point2/vectorConfusion.$(MEXENDING)
|
Point2: new_Point2_.$(MEXENDING) @Point2/x.$(MEXENDING) @Point2/y.$(MEXENDING) @Point2/dim.$(MEXENDING) @Point2/returnChar.$(MEXENDING) @Point2/argChar.$(MEXENDING) @Point2/argUChar.$(MEXENDING) @Point2/vectorConfusion.$(MEXENDING)
|
||||||
|
|
||||||
# Point3
|
# Point3
|
||||||
new_Point3_.$(MEXENDING): new_Point3_.cpp
|
new_Point3_.$(MEXENDING): new_Point3_.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) new_Point3_.cpp -output new_Point3_
|
$(MEX) $(mex_flags) new_Point3_.cpp -output new_Point3_
|
||||||
Point3_staticFunction.$(MEXENDING): Point3_staticFunction.cpp
|
Point3_staticFunction.$(MEXENDING): Point3_staticFunction.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) Point3_staticFunction.cpp -output Point3_staticFunction
|
$(MEX) $(mex_flags) Point3_staticFunction.cpp -output Point3_staticFunction
|
||||||
Point3_StaticFunctionRet.$(MEXENDING): Point3_StaticFunctionRet.cpp
|
Point3_StaticFunctionRet.$(MEXENDING): Point3_StaticFunctionRet.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) Point3_StaticFunctionRet.cpp -output Point3_StaticFunctionRet
|
$(MEX) $(mex_flags) Point3_StaticFunctionRet.cpp -output Point3_StaticFunctionRet
|
||||||
@Point3/norm.$(MEXENDING): @Point3/norm.cpp
|
@Point3/norm.$(MEXENDING): @Point3/norm.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Point3/norm.cpp -output @Point3/norm
|
$(MEX) $(mex_flags) @Point3/norm.cpp -output @Point3/norm
|
||||||
|
|
||||||
Point3: new_Point3_.$(MEXENDING) Point3_staticFunction.$(MEXENDING) Point3_StaticFunctionRet.$(MEXENDING) @Point3/norm.$(MEXENDING)
|
Point3: new_Point3_.$(MEXENDING) Point3_staticFunction.$(MEXENDING) Point3_StaticFunctionRet.$(MEXENDING) @Point3/norm.$(MEXENDING)
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
new_Test_.$(MEXENDING): new_Test_.cpp
|
new_Test_.$(MEXENDING): new_Test_.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) new_Test_.cpp -output new_Test_
|
$(MEX) $(mex_flags) new_Test_.cpp -output new_Test_
|
||||||
@Test/return_pair.$(MEXENDING): @Test/return_pair.cpp
|
@Test/return_pair.$(MEXENDING): @Test/return_pair.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_pair.cpp -output @Test/return_pair
|
$(MEX) $(mex_flags) @Test/return_pair.cpp -output @Test/return_pair
|
||||||
@Test/return_bool.$(MEXENDING): @Test/return_bool.cpp
|
@Test/return_bool.$(MEXENDING): @Test/return_bool.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_bool.cpp -output @Test/return_bool
|
$(MEX) $(mex_flags) @Test/return_bool.cpp -output @Test/return_bool
|
||||||
@Test/return_size_t.$(MEXENDING): @Test/return_size_t.cpp
|
@Test/return_size_t.$(MEXENDING): @Test/return_size_t.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_size_t.cpp -output @Test/return_size_t
|
$(MEX) $(mex_flags) @Test/return_size_t.cpp -output @Test/return_size_t
|
||||||
@Test/return_int.$(MEXENDING): @Test/return_int.cpp
|
@Test/return_int.$(MEXENDING): @Test/return_int.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_int.cpp -output @Test/return_int
|
$(MEX) $(mex_flags) @Test/return_int.cpp -output @Test/return_int
|
||||||
@Test/return_double.$(MEXENDING): @Test/return_double.cpp
|
@Test/return_double.$(MEXENDING): @Test/return_double.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_double.cpp -output @Test/return_double
|
$(MEX) $(mex_flags) @Test/return_double.cpp -output @Test/return_double
|
||||||
@Test/return_string.$(MEXENDING): @Test/return_string.cpp
|
@Test/return_string.$(MEXENDING): @Test/return_string.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_string.cpp -output @Test/return_string
|
$(MEX) $(mex_flags) @Test/return_string.cpp -output @Test/return_string
|
||||||
@Test/return_vector1.$(MEXENDING): @Test/return_vector1.cpp
|
@Test/return_vector1.$(MEXENDING): @Test/return_vector1.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_vector1.cpp -output @Test/return_vector1
|
$(MEX) $(mex_flags) @Test/return_vector1.cpp -output @Test/return_vector1
|
||||||
@Test/return_matrix1.$(MEXENDING): @Test/return_matrix1.cpp
|
@Test/return_matrix1.$(MEXENDING): @Test/return_matrix1.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_matrix1.cpp -output @Test/return_matrix1
|
$(MEX) $(mex_flags) @Test/return_matrix1.cpp -output @Test/return_matrix1
|
||||||
@Test/return_vector2.$(MEXENDING): @Test/return_vector2.cpp
|
@Test/return_vector2.$(MEXENDING): @Test/return_vector2.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_vector2.cpp -output @Test/return_vector2
|
$(MEX) $(mex_flags) @Test/return_vector2.cpp -output @Test/return_vector2
|
||||||
@Test/return_matrix2.$(MEXENDING): @Test/return_matrix2.cpp
|
@Test/return_matrix2.$(MEXENDING): @Test/return_matrix2.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_matrix2.cpp -output @Test/return_matrix2
|
$(MEX) $(mex_flags) @Test/return_matrix2.cpp -output @Test/return_matrix2
|
||||||
@Test/arg_EigenConstRef.$(MEXENDING): @Test/arg_EigenConstRef.cpp
|
@Test/arg_EigenConstRef.$(MEXENDING): @Test/arg_EigenConstRef.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/arg_EigenConstRef.cpp -output @Test/arg_EigenConstRef
|
$(MEX) $(mex_flags) @Test/arg_EigenConstRef.cpp -output @Test/arg_EigenConstRef
|
||||||
@Test/return_field.$(MEXENDING): @Test/return_field.cpp
|
@Test/return_field.$(MEXENDING): @Test/return_field.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_field.cpp -output @Test/return_field
|
$(MEX) $(mex_flags) @Test/return_field.cpp -output @Test/return_field
|
||||||
@Test/return_TestPtr.$(MEXENDING): @Test/return_TestPtr.cpp
|
@Test/return_TestPtr.$(MEXENDING): @Test/return_TestPtr.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_TestPtr.cpp -output @Test/return_TestPtr
|
$(MEX) $(mex_flags) @Test/return_TestPtr.cpp -output @Test/return_TestPtr
|
||||||
@Test/return_Test.$(MEXENDING): @Test/return_Test.cpp
|
@Test/return_Test.$(MEXENDING): @Test/return_Test.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_Test.cpp -output @Test/return_Test
|
$(MEX) $(mex_flags) @Test/return_Test.cpp -output @Test/return_Test
|
||||||
@Test/return_Point2Ptr.$(MEXENDING): @Test/return_Point2Ptr.cpp
|
@Test/return_Point2Ptr.$(MEXENDING): @Test/return_Point2Ptr.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_Point2Ptr.cpp -output @Test/return_Point2Ptr
|
$(MEX) $(mex_flags) @Test/return_Point2Ptr.cpp -output @Test/return_Point2Ptr
|
||||||
@Test/create_ptrs.$(MEXENDING): @Test/create_ptrs.cpp
|
@Test/create_ptrs.$(MEXENDING): @Test/create_ptrs.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/create_ptrs.cpp -output @Test/create_ptrs
|
$(MEX) $(mex_flags) @Test/create_ptrs.cpp -output @Test/create_ptrs
|
||||||
@Test/create_MixedPtrs.$(MEXENDING): @Test/create_MixedPtrs.cpp
|
@Test/create_MixedPtrs.$(MEXENDING): @Test/create_MixedPtrs.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/create_MixedPtrs.cpp -output @Test/create_MixedPtrs
|
$(MEX) $(mex_flags) @Test/create_MixedPtrs.cpp -output @Test/create_MixedPtrs
|
||||||
@Test/return_ptrs.$(MEXENDING): @Test/return_ptrs.cpp
|
@Test/return_ptrs.$(MEXENDING): @Test/return_ptrs.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/return_ptrs.cpp -output @Test/return_ptrs
|
$(MEX) $(mex_flags) @Test/return_ptrs.cpp -output @Test/return_ptrs
|
||||||
@Test/print.$(MEXENDING): @Test/print.cpp
|
@Test/print.$(MEXENDING): @Test/print.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @Test/print.cpp -output @Test/print
|
$(MEX) $(mex_flags) @Test/print.cpp -output @Test/print
|
||||||
|
|
||||||
Test: new_Test_.$(MEXENDING) @Test/return_pair.$(MEXENDING) @Test/return_bool.$(MEXENDING) @Test/return_size_t.$(MEXENDING) @Test/return_int.$(MEXENDING) @Test/return_double.$(MEXENDING) @Test/return_string.$(MEXENDING) @Test/return_vector1.$(MEXENDING) @Test/return_matrix1.$(MEXENDING) @Test/return_vector2.$(MEXENDING) @Test/return_matrix2.$(MEXENDING) @Test/arg_EigenConstRef.$(MEXENDING) @Test/return_field.$(MEXENDING) @Test/return_TestPtr.$(MEXENDING) @Test/return_Test.$(MEXENDING) @Test/return_Point2Ptr.$(MEXENDING) @Test/create_ptrs.$(MEXENDING) @Test/create_MixedPtrs.$(MEXENDING) @Test/return_ptrs.$(MEXENDING) @Test/print.$(MEXENDING)
|
Test: new_Test_.$(MEXENDING) @Test/return_pair.$(MEXENDING) @Test/return_bool.$(MEXENDING) @Test/return_size_t.$(MEXENDING) @Test/return_int.$(MEXENDING) @Test/return_double.$(MEXENDING) @Test/return_string.$(MEXENDING) @Test/return_vector1.$(MEXENDING) @Test/return_matrix1.$(MEXENDING) @Test/return_vector2.$(MEXENDING) @Test/return_matrix2.$(MEXENDING) @Test/arg_EigenConstRef.$(MEXENDING) @Test/return_field.$(MEXENDING) @Test/return_TestPtr.$(MEXENDING) @Test/return_Test.$(MEXENDING) @Test/return_Point2Ptr.$(MEXENDING) @Test/create_ptrs.$(MEXENDING) @Test/create_MixedPtrs.$(MEXENDING) @Test/return_ptrs.$(MEXENDING) @Test/print.$(MEXENDING)
|
||||||
|
|
|
@ -41,7 +41,6 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
self = new Shared(new Point2(x,y));
|
self = new Shared(new Point2(x,y));
|
||||||
}
|
}
|
||||||
collector.insert(self);
|
collector.insert(self);
|
||||||
std::cout << "constructed " << self << ", size=" << collector.size() << std::endl;
|
|
||||||
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
||||||
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,6 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
self = new Shared(new Point3(x,y,z));
|
self = new Shared(new Point3(x,y,z));
|
||||||
}
|
}
|
||||||
collector.insert(self);
|
collector.insert(self);
|
||||||
std::cout << "constructed " << self << ", size=" << collector.size() << std::endl;
|
|
||||||
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
||||||
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,6 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
self = new Shared(new Test(a,b));
|
self = new Shared(new Test(a,b));
|
||||||
}
|
}
|
||||||
collector.insert(self);
|
collector.insert(self);
|
||||||
std::cout << "constructed " << self << ", size=" << collector.size() << std::endl;
|
|
||||||
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
||||||
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,50 +2,51 @@
|
||||||
|
|
||||||
MEX = mex
|
MEX = mex
|
||||||
MEXENDING = mexa64
|
MEXENDING = mexa64
|
||||||
|
PATH_TO_WRAP = /not_really_a_real_path/borg/gtsam/wrap
|
||||||
mex_flags = -O5
|
mex_flags = -O5
|
||||||
|
|
||||||
all: ns1ClassA ns1ClassB ns2ClassA ns2ns3ClassB ns2ClassC ClassD
|
all: ns1ClassA ns1ClassB ns2ClassA ns2ns3ClassB ns2ClassC ClassD
|
||||||
|
|
||||||
# ns1ClassA
|
# ns1ClassA
|
||||||
new_ns1ClassA_.$(MEXENDING): new_ns1ClassA_.cpp
|
new_ns1ClassA_.$(MEXENDING): new_ns1ClassA_.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) new_ns1ClassA_.cpp -output new_ns1ClassA_
|
$(MEX) $(mex_flags) new_ns1ClassA_.cpp -output new_ns1ClassA_
|
||||||
|
|
||||||
ns1ClassA: new_ns1ClassA_.$(MEXENDING)
|
ns1ClassA: new_ns1ClassA_.$(MEXENDING)
|
||||||
|
|
||||||
# ns1ClassB
|
# ns1ClassB
|
||||||
new_ns1ClassB_.$(MEXENDING): new_ns1ClassB_.cpp
|
new_ns1ClassB_.$(MEXENDING): new_ns1ClassB_.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) new_ns1ClassB_.cpp -output new_ns1ClassB_
|
$(MEX) $(mex_flags) new_ns1ClassB_.cpp -output new_ns1ClassB_
|
||||||
|
|
||||||
ns1ClassB: new_ns1ClassB_.$(MEXENDING)
|
ns1ClassB: new_ns1ClassB_.$(MEXENDING)
|
||||||
|
|
||||||
# ns2ClassA
|
# ns2ClassA
|
||||||
new_ns2ClassA_.$(MEXENDING): new_ns2ClassA_.cpp
|
new_ns2ClassA_.$(MEXENDING): new_ns2ClassA_.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) new_ns2ClassA_.cpp -output new_ns2ClassA_
|
$(MEX) $(mex_flags) new_ns2ClassA_.cpp -output new_ns2ClassA_
|
||||||
ns2ClassA_afunction.$(MEXENDING): ns2ClassA_afunction.cpp
|
ns2ClassA_afunction.$(MEXENDING): ns2ClassA_afunction.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) ns2ClassA_afunction.cpp -output ns2ClassA_afunction
|
$(MEX) $(mex_flags) ns2ClassA_afunction.cpp -output ns2ClassA_afunction
|
||||||
@ns2ClassA/memberFunction.$(MEXENDING): @ns2ClassA/memberFunction.cpp
|
@ns2ClassA/memberFunction.$(MEXENDING): @ns2ClassA/memberFunction.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @ns2ClassA/memberFunction.cpp -output @ns2ClassA/memberFunction
|
$(MEX) $(mex_flags) @ns2ClassA/memberFunction.cpp -output @ns2ClassA/memberFunction
|
||||||
@ns2ClassA/nsArg.$(MEXENDING): @ns2ClassA/nsArg.cpp
|
@ns2ClassA/nsArg.$(MEXENDING): @ns2ClassA/nsArg.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @ns2ClassA/nsArg.cpp -output @ns2ClassA/nsArg
|
$(MEX) $(mex_flags) @ns2ClassA/nsArg.cpp -output @ns2ClassA/nsArg
|
||||||
@ns2ClassA/nsReturn.$(MEXENDING): @ns2ClassA/nsReturn.cpp
|
@ns2ClassA/nsReturn.$(MEXENDING): @ns2ClassA/nsReturn.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) @ns2ClassA/nsReturn.cpp -output @ns2ClassA/nsReturn
|
$(MEX) $(mex_flags) @ns2ClassA/nsReturn.cpp -output @ns2ClassA/nsReturn
|
||||||
|
|
||||||
ns2ClassA: new_ns2ClassA_.$(MEXENDING) ns2ClassA_afunction.$(MEXENDING) @ns2ClassA/memberFunction.$(MEXENDING) @ns2ClassA/nsArg.$(MEXENDING) @ns2ClassA/nsReturn.$(MEXENDING)
|
ns2ClassA: new_ns2ClassA_.$(MEXENDING) ns2ClassA_afunction.$(MEXENDING) @ns2ClassA/memberFunction.$(MEXENDING) @ns2ClassA/nsArg.$(MEXENDING) @ns2ClassA/nsReturn.$(MEXENDING)
|
||||||
|
|
||||||
# ns2ns3ClassB
|
# ns2ns3ClassB
|
||||||
new_ns2ns3ClassB_.$(MEXENDING): new_ns2ns3ClassB_.cpp
|
new_ns2ns3ClassB_.$(MEXENDING): new_ns2ns3ClassB_.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) new_ns2ns3ClassB_.cpp -output new_ns2ns3ClassB_
|
$(MEX) $(mex_flags) new_ns2ns3ClassB_.cpp -output new_ns2ns3ClassB_
|
||||||
|
|
||||||
ns2ns3ClassB: new_ns2ns3ClassB_.$(MEXENDING)
|
ns2ns3ClassB: new_ns2ns3ClassB_.$(MEXENDING)
|
||||||
|
|
||||||
# ns2ClassC
|
# ns2ClassC
|
||||||
new_ns2ClassC_.$(MEXENDING): new_ns2ClassC_.cpp
|
new_ns2ClassC_.$(MEXENDING): new_ns2ClassC_.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) new_ns2ClassC_.cpp -output new_ns2ClassC_
|
$(MEX) $(mex_flags) new_ns2ClassC_.cpp -output new_ns2ClassC_
|
||||||
|
|
||||||
ns2ClassC: new_ns2ClassC_.$(MEXENDING)
|
ns2ClassC: new_ns2ClassC_.$(MEXENDING)
|
||||||
|
|
||||||
# ClassD
|
# ClassD
|
||||||
new_ClassD_.$(MEXENDING): new_ClassD_.cpp
|
new_ClassD_.$(MEXENDING): new_ClassD_.cpp $(PATH_TO_WRAP)/matlab.h
|
||||||
$(MEX) $(mex_flags) new_ClassD_.cpp -output new_ClassD_
|
$(MEX) $(mex_flags) new_ClassD_.cpp -output new_ClassD_
|
||||||
|
|
||||||
ClassD: new_ClassD_.$(MEXENDING)
|
ClassD: new_ClassD_.$(MEXENDING)
|
||||||
|
|
|
@ -36,7 +36,6 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
self = new Shared(new ClassD());
|
self = new Shared(new ClassD());
|
||||||
}
|
}
|
||||||
collector.insert(self);
|
collector.insert(self);
|
||||||
std::cout << "constructed " << self << ", size=" << collector.size() << std::endl;
|
|
||||||
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
||||||
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,6 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
self = new Shared(new ns1::ClassA());
|
self = new Shared(new ns1::ClassA());
|
||||||
}
|
}
|
||||||
collector.insert(self);
|
collector.insert(self);
|
||||||
std::cout << "constructed " << self << ", size=" << collector.size() << std::endl;
|
|
||||||
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
||||||
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
self = new Shared(new ns1::ClassB());
|
self = new Shared(new ns1::ClassB());
|
||||||
}
|
}
|
||||||
collector.insert(self);
|
collector.insert(self);
|
||||||
std::cout << "constructed " << self << ", size=" << collector.size() << std::endl;
|
|
||||||
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
||||||
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
self = new Shared(new ns2::ClassA());
|
self = new Shared(new ns2::ClassA());
|
||||||
}
|
}
|
||||||
collector.insert(self);
|
collector.insert(self);
|
||||||
std::cout << "constructed " << self << ", size=" << collector.size() << std::endl;
|
|
||||||
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
||||||
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,6 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
self = new Shared(new ns2::ClassC());
|
self = new Shared(new ns2::ClassC());
|
||||||
}
|
}
|
||||||
collector.insert(self);
|
collector.insert(self);
|
||||||
std::cout << "constructed " << self << ", size=" << collector.size() << std::endl;
|
|
||||||
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
||||||
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
|
||||||
self = new Shared(new ns2::ns3::ClassB());
|
self = new Shared(new ns2::ns3::ClassB());
|
||||||
}
|
}
|
||||||
collector.insert(self);
|
collector.insert(self);
|
||||||
std::cout << "constructed " << self << ", size=" << collector.size() << std::endl;
|
|
||||||
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL);
|
||||||
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
*reinterpret_cast<Shared**> (mxGetPr(out[0])) = self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,10 @@ static string topdir = "TOPSRCDIR_NOT_CONFIGURED"; // If TOPSRCDIR is not define
|
||||||
|
|
||||||
typedef vector<string> strvec;
|
typedef vector<string> strvec;
|
||||||
|
|
||||||
|
// NOTE: as this path is only used to generate makefiles, it is hardcoded here for testing
|
||||||
|
// In practice, this path will be an absolute system path, which makes testing it more annoying
|
||||||
|
static const std::string headerPath = "/not_really_a_real_path/borg/gtsam/wrap";
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
TEST( wrap, ArgumentList ) {
|
TEST( wrap, ArgumentList ) {
|
||||||
ArgumentList args;
|
ArgumentList args;
|
||||||
|
@ -63,13 +67,13 @@ TEST( wrap, check_exception ) {
|
||||||
|
|
||||||
string path = topdir + "/wrap/tests";
|
string path = topdir + "/wrap/tests";
|
||||||
Module module(path.c_str(), "testDependencies",enable_verbose);
|
Module module(path.c_str(), "testDependencies",enable_verbose);
|
||||||
CHECK_EXCEPTION(module.matlab_code("mex", "actual_deps", "mexa64", "-O5"), DependencyMissing);
|
CHECK_EXCEPTION(module.matlab_code("mex", "actual_deps", "mexa64", headerPath, "-O5"), DependencyMissing);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
TEST( wrap, parse ) {
|
TEST( wrap, parse ) {
|
||||||
string header_path = topdir + "/wrap/tests";
|
string markup_header_path = topdir + "/wrap/tests";
|
||||||
Module module(header_path.c_str(), "geometry",enable_verbose);
|
Module module(markup_header_path.c_str(), "geometry",enable_verbose);
|
||||||
EXPECT_LONGS_EQUAL(3, module.classes.size());
|
EXPECT_LONGS_EQUAL(3, module.classes.size());
|
||||||
|
|
||||||
// check using declarations
|
// check using declarations
|
||||||
|
@ -214,7 +218,7 @@ TEST( wrap, matlab_code_namespaces ) {
|
||||||
// emit MATLAB code
|
// emit MATLAB code
|
||||||
string exp_path = path + "/tests/expected_namespaces/";
|
string exp_path = path + "/tests/expected_namespaces/";
|
||||||
string act_path = "actual_namespaces/";
|
string act_path = "actual_namespaces/";
|
||||||
module.matlab_code("mex", "actual_namespaces", "mexa64", "-O5");
|
module.matlab_code("mex", "actual_namespaces", "mexa64", headerPath, "-O5");
|
||||||
|
|
||||||
EXPECT(files_equal(exp_path + "new_ClassD_.cpp" , act_path + "new_ClassD_.cpp" ));
|
EXPECT(files_equal(exp_path + "new_ClassD_.cpp" , act_path + "new_ClassD_.cpp" ));
|
||||||
EXPECT(files_equal(exp_path + "new_ClassD_.m" , act_path + "new_ClassD_.m" ));
|
EXPECT(files_equal(exp_path + "new_ClassD_.m" , act_path + "new_ClassD_.m" ));
|
||||||
|
@ -255,7 +259,7 @@ TEST( wrap, matlab_code ) {
|
||||||
|
|
||||||
// emit MATLAB code
|
// emit MATLAB code
|
||||||
// make_geometry will not compile, use make testwrap to generate real make
|
// make_geometry will not compile, use make testwrap to generate real make
|
||||||
module.matlab_code("mex", "actual", "mexa64", "-O5");
|
module.matlab_code("mex", "actual", "mexa64", headerPath, "-O5");
|
||||||
string epath = path + "/tests/expected/";
|
string epath = path + "/tests/expected/";
|
||||||
string apath = "actual/";
|
string apath = "actual/";
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ using namespace std;
|
||||||
* @param interfacePath path to where interface file lives, e.g., borg/gtsam
|
* @param interfacePath path to where interface file lives, e.g., borg/gtsam
|
||||||
* @param moduleName name of the module to be generated e.g. gtsam
|
* @param moduleName name of the module to be generated e.g. gtsam
|
||||||
* @param toolboxPath path where the toolbox should be generated, e.g. borg/gtsam/build
|
* @param toolboxPath path where the toolbox should be generated, e.g. borg/gtsam/build
|
||||||
* @param nameSpace e.g. gtsam
|
* @param headerPath is the path to matlab.h
|
||||||
* @param mexFlags extra arguments for mex script, i.e., include flags etc...
|
* @param mexFlags extra arguments for mex script, i.e., include flags etc...
|
||||||
*/
|
*/
|
||||||
void generate_matlab_toolbox(
|
void generate_matlab_toolbox(
|
||||||
|
@ -58,6 +58,7 @@ void usage() {
|
||||||
cerr << " interfacePath : *absolute* path to directory of module interface file" << endl;
|
cerr << " interfacePath : *absolute* path to directory of module interface file" << endl;
|
||||||
cerr << " moduleName : the name of the module, interface file must be called moduleName.h" << endl;
|
cerr << " moduleName : the name of the module, interface file must be called moduleName.h" << endl;
|
||||||
cerr << " toolboxPath : the directory in which to generate the wrappers" << endl;
|
cerr << " toolboxPath : the directory in which to generate the wrappers" << endl;
|
||||||
|
cerr << " headerPath : path to matlab.h" << endl;
|
||||||
cerr << " [mexFlags] : extra flags for the mex command" << endl;
|
cerr << " [mexFlags] : extra flags for the mex command" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue