diff --git a/.cproject b/.cproject
index 241afea81..bcf690995 100644
--- a/.cproject
+++ b/.cproject
@@ -592,6 +592,7 @@
make
+
tests/testBayesTree.run
true
false
@@ -599,6 +600,7 @@
make
+
testBinaryBayesNet.run
true
false
@@ -646,6 +648,7 @@
make
+
testSymbolicBayesNet.run
true
false
@@ -653,6 +656,7 @@
make
+
tests/testSymbolicFactor.run
true
false
@@ -660,6 +664,7 @@
make
+
testSymbolicFactorGraph.run
true
false
@@ -675,6 +680,7 @@
make
+
tests/testBayesTree
true
false
@@ -1122,6 +1128,7 @@
make
+
testErrors.run
true
false
@@ -1351,6 +1358,46 @@
true
true
+
+ make
+ -j5
+ testBTree.run
+ true
+ true
+ true
+
+
+ make
+ -j5
+ testDSF.run
+ true
+ true
+ true
+
+
+ make
+ -j5
+ testDSFMap.run
+ true
+ true
+ true
+
+
+ make
+ -j5
+ testDSFVector.run
+ true
+ true
+ true
+
+
+ make
+ -j5
+ testFixedVector.run
+ true
+ true
+ true
+
make
-j2
@@ -1433,7 +1480,6 @@
make
-
testSimulated2DOriented.run
true
false
@@ -1473,7 +1519,6 @@
make
-
testSimulated2D.run
true
false
@@ -1481,7 +1526,6 @@
make
-
testSimulated3D.run
true
false
@@ -1495,46 +1539,6 @@
true
true
-
- make
- -j5
- testBTree.run
- true
- true
- true
-
-
- make
- -j5
- testDSF.run
- true
- true
- true
-
-
- make
- -j5
- testDSFMap.run
- true
- true
- true
-
-
- make
- -j5
- testDSFVector.run
- true
- true
- true
-
-
- make
- -j5
- testFixedVector.run
- true
- true
- true
-
make
-j5
@@ -1792,6 +1796,7 @@
cpack
+
-G DEB
true
false
@@ -1799,6 +1804,7 @@
cpack
+
-G RPM
true
false
@@ -1806,6 +1812,7 @@
cpack
+
-G TGZ
true
false
@@ -1813,6 +1820,7 @@
cpack
+
--config CPackSourceConfig.cmake
true
false
@@ -2425,6 +2433,14 @@
true
true
+
+ make
+ -j4
+ testGlobalFunction.run
+ true
+ true
+ true
+
make
-j5
@@ -2659,6 +2675,7 @@
make
+
testGraph.run
true
false
@@ -2666,6 +2683,7 @@
make
+
testJunctionTree.run
true
false
@@ -2673,6 +2691,7 @@
make
+
testSymbolicBayesNetB.run
true
false
@@ -3216,7 +3235,6 @@
make
-
tests/testGaussianISAM2
true
false
diff --git a/wrap/tests/testGlobalFunction.cpp b/wrap/tests/testGlobalFunction.cpp
new file mode 100644
index 000000000..bd2159588
--- /dev/null
+++ b/wrap/tests/testGlobalFunction.cpp
@@ -0,0 +1,120 @@
+/* ----------------------------------------------------------------------------
+
+ * GTSAM Copyright 2010, Georgia Tech Research Corporation,
+ * Atlanta, Georgia 30332-0415
+ * All Rights Reserved
+ * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
+
+ * See LICENSE for the license information
+
+ * -------------------------------------------------------------------------- */
+
+/**
+ * @file testMethod.cpp
+ * @brief Unit test for GlobalFunction class
+ * @author Frank Dellaert
+ * @date Nov 12, 2014
+ **/
+
+#include
+#include
+#include
+
+using namespace std;
+using namespace wrap;
+
+//******************************************************************************
+// Constructor
+TEST( GlobalFunction, Constructor ) {
+ GlobalFunction f;
+}
+
+/* ************************************************************************* */
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#endif
+#include
+#include
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
+namespace bl = boost::lambda;
+// http://boost-spirit.com/distrib/spirit_1_8_2/libs/spirit/doc/grammar.html
+struct GlobalFunctionGrammar: public classic::grammar {
+
+ GlobalFunctions& global_functions_; ///< successful parse will be placed in here
+
+ /// Construct type grammar and specify where result is placed
+ GlobalFunctionGrammar(GlobalFunctions& global_functions) :
+ global_functions_(global_functions) {
+ }
+
+ /// Definition of type grammar
+ template
+ struct definition: BasicRules {
+
+// using BasicRules::name_p;
+// using BasicRules::className_p;
+ using BasicRules::comments_p;
+
+ ArgumentList args;
+ ArgumentListGrammar argumentList_g;
+
+ ReturnValue retVal0, retVal;
+ ReturnValueGrammar returnValue_g;
+
+ Qualified globalFunction;
+
+ classic::rule globalFunctionName_p, global_function_p;
+
+ definition(GlobalFunctionGrammar const& self) :
+ argumentList_g(args), returnValue_g(retVal) {
+
+ using namespace classic;
+ bool verbose = false; // TODO
+
+ globalFunctionName_p = lexeme_d[(upper_p | lower_p) >> *(alnum_p | '_')];
+
+ // parse a global function
+ global_function_p = (returnValue_g
+ >> globalFunctionName_p[assign_a(globalFunction.name_)]
+ >> argumentList_g >> ';' >> *comments_p) //
+ [bl::bind(&GlobalFunction::addOverload,
+ bl::var(self.global_functions_)[bl::var(globalFunction.name_)],
+ bl::var(globalFunction), bl::var(args), bl::var(retVal),
+ boost::none, verbose)] //
+ [assign_a(retVal, retVal0)][clear_a(globalFunction)][clear_a(args)];
+
+ }
+
+ classic::rule const& start() const {
+ return global_function_p;
+ }
+
+ };
+};
+// GlobalFunctionGrammar
+
+//******************************************************************************
+TEST( GlobalFunction, Grammar ) {
+
+ using classic::space_p;
+
+ // Create type grammar that will place result in actual
+ GlobalFunctions actual;
+ GlobalFunctionGrammar g(actual);
+
+ // a class type with namespaces
+ EXPECT(parse("Vector aGlobalFunction();", g, space_p).full);
+ EXPECT(parse("Vector overloadedGlobalFunction(int a);", g, space_p).full);
+ EXPECT(parse("Vector overloadedGlobalFunction(int a, double b);", g, space_p).full);
+}
+
+//******************************************************************************
+int main() {
+ TestResult tr;
+ return TestRegistry::runAllTests(tr);
+}
+//******************************************************************************