Date: Monday, December 5, 2005 @ 14:03:37
  Author: csaba
    Path: /cvsroot/carob/libmysequoia

   Added: test/TestCarobMySQL.cpp (1.1) test/TestCarobMySQL.hpp (1.1)
          test/TestMySQLAPI.cpp (1.1) test/TestMySQLAPI.hpp (1.1)
          test/runTests.cpp (1.1)
Modified: Makefile (1.5 -> 1.6) test/Makefile (1.1 -> 1.2)

Added the initial unit test skeleton.


-------------------------+
 Makefile                |   35 ++++++++++++++++------------------
 test/Makefile           |   24 ++++++++++++++++++++---
 test/TestCarobMySQL.cpp |   39 ++++++++++++++++++++++++++++++++++++++
 test/TestCarobMySQL.hpp |   47 ++++++++++++++++++++++++++++++++++++++++++++++
 test/TestMySQLAPI.cpp   |   39 ++++++++++++++++++++++++++++++++++++++
 test/TestMySQLAPI.hpp   |   47 ++++++++++++++++++++++++++++++++++++++++++++++
 test/runTests.cpp       |   37 ++++++++++++++++++++++++++++++++++++
 7 files changed, 247 insertions(+), 21 deletions(-)


Index: libmysequoia/Makefile
diff -u libmysequoia/Makefile:1.5 libmysequoia/Makefile:1.6
--- libmysequoia/Makefile:1.5   Fri Dec  2 13:54:20 2005
+++ libmysequoia/Makefile       Mon Dec  5 14:03:36 2005
@@ -1,6 +1,5 @@
-#
 # Sequoia: Database clustering technology.
-# Copyright (C) 2005 Emic Networks
+# Copyright (C) 2005 Continuent, Inc.
 # Contact: [EMAIL PROTECTED]
 # 
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,31 +27,31 @@
 
 # Tools
 
-RM                                     = /bin/rm -f
-RMDIR                          = /bin/rm -rf
-LN                                     = /bin/ln -s
-DOXYGEN                                = /usr/bin/doxygen
+RM      = /bin/rm -f
+RMDIR   = /bin/rm -rf
+LN      = /bin/ln -s
+DOXYGEN = /usr/bin/doxygen
 
 # Dirs
-INCDIR                         = -Iinclude -I../carob/include `mysql_config 
--include`
-SRCDIR                         = src
+INCDIR  = -Iinclude -I../carob/include `mysql_config --include`
+SRCDIR  = src
 
 # LibMySequoia C++ lib
-OBJS                                           = ${SRCDIR}/CarobMySQL.o\
-                                                 ${SRCDIR}/MySQLAPI.o
-CXXFLAGS                                       = -g3 -Wall ${INCDIR}
-LDFLAGS                                        = -fPIC --shared -L../carob 
-lcarobcpp
-LIB_MYSEQUOIA                  = mysequoia
+OBJS  = ${SRCDIR}/CarobMySQL.o\
+        ${SRCDIR}/MySQLAPI.o
+CXXFLAGS = -g3 -Wall ${INCDIR}
+LDFLAGS = -fPIC --shared -Wl,-rpath,../carob -L../carob -lcarobcpp
+LIB_MYSEQUOIA = mysequoia
 LIB_MYSEQUOIA_LIB_SHORT = lib${LIB_MYSEQUOIA}.so
-LIB_MYSEQUOIA_LIB              = 
${LIB_MYSEQUOIA_LIB_SHORT}.${LIB_MAJOR_VERSION}
+LIB_MYSEQUOIA_LIB = ${LIB_MYSEQUOIA_LIB_SHORT}.${LIB_MAJOR_VERSION}
 
 
 # Doc
 # DOC_DIR is duplicated in Doxyfile
-DOC_DIR                                = doc
-DOC_OUT                                = ${DOC_DIR}/html
-DOXYFILE                               = ${DOC_DIR}/Doxyfile
-DOC_HTML                               = ${DOC_OUT}/index.html
+DOC_DIR   = doc
+DOC_OUT   = ${DOC_DIR}/html
+DOXYFILE  = ${DOC_DIR}/Doxyfile
+DOC_HTML  = ${DOC_OUT}/index.html
 
 all: lib
 
Index: libmysequoia/test/Makefile
diff -u libmysequoia/test/Makefile:1.1 libmysequoia/test/Makefile:1.2
--- libmysequoia/test/Makefile:1.1      Fri Dec  2 13:54:20 2005
+++ libmysequoia/test/Makefile  Mon Dec  5 14:03:37 2005
@@ -1,6 +1,5 @@
-#
 # Sequoia: Database clustering technology.
-# Copyright (C) 2005 Emic Networks
+# Copyright (C) 2005 Continuent, Inc. 
 # Contact: [EMAIL PROTECTED]
 # 
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,6 +22,25 @@
 # Makefile for LibMySequoia and tests
 #
 
-all:
+# Put an absolute path in here to be able to run from any directory
+MYSEQUOIA_ROOT  = ..
+CAROB_ROOT      = ../../carob
+
+LIB_MYSEQUOIA = mysequoia
+LIB_CPPUNIT   = cppunit
+
+INCDIR    = -I../include -I../../carob/include `mysql_config --include`
+CXXFLAGS  = -g3 -Wall ${INCDIR}
+LDFLAGS   = -Wl,-rpath,${MYSEQUOIA_ROOT} -Wl,-rpath,${CAROB_ROOT} \
+            -L${MYSEQUOIA_ROOT} -l${LIB_MYSEQUOIA} -ldl -l${LIB_CPPUNIT} 
-rdynamic
+EXE       = runTests
+
+TESTOBJS =  runTests.o \
+            TestCarobMySQL.o \
+            TestMySQLAPI.o
+
+${EXE}: ${TESTOBJS}
+       ${CXX} ${LDFLAGS} -o $@ $^
 
 clean:
+       ${RM} ${TESTOBJS} ${EXE}
Index: libmysequoia/test/TestCarobMySQL.cpp
diff -u /dev/null libmysequoia/test/TestCarobMySQL.cpp:1.1
--- /dev/null   Mon Dec  5 14:03:37 2005
+++ libmysequoia/test/TestCarobMySQL.cpp        Mon Dec  5 14:03:37 2005
@@ -0,0 +1,39 @@
+/*
+ * Sequoia: Database clustering technology.
+ * Copyright (C) 2005 Continuent, Inc.
+ * Contact: [EMAIL PROTECTED]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Initial developer(s): Zsolt Simon, Csaba Simon
+ * Contributor(s): 
+ */
+
+#include "TestCarobMySQL.hpp"
+
+CPPUNIT_TEST_SUITE_REGISTRATION (TestCarobMySQL);
+
+void TestCarobMySQL::setUp(void)
+{
+  carobMySQL = new CarobMYSQL();
+}
+
+void TestCarobMySQL::tearDown(void) 
+{
+  delete carobMySQL;
+}
+
+void TestCarobMySQL::firstTest(void)
+{
+  CPPUNIT_ASSERT_EQUAL (1 + 1, 2);
+}
Index: libmysequoia/test/TestCarobMySQL.hpp
diff -u /dev/null libmysequoia/test/TestCarobMySQL.hpp:1.1
--- /dev/null   Mon Dec  5 14:03:37 2005
+++ libmysequoia/test/TestCarobMySQL.hpp        Mon Dec  5 14:03:37 2005
@@ -0,0 +1,47 @@
+/*
+ * Sequoia: Database clustering technology.
+ * Copyright (C) 2005 Continuent, Inc.
+ * Contact: [EMAIL PROTECTED]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Initial developer(s): Zsolt Simon, Csaba Simon
+ * Contributor(s): 
+ */
+
+#ifndef _TESTCAROBMYSQL_HPP
+#define _TESTCAROBMYSQL_HPP
+
+#include "CarobMySQL.hpp"
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+class TestCarobMySQL : public CPPUNIT_NS::TestFixture
+{
+  CPPUNIT_TEST_SUITE (TestCarobMySQL);
+    CPPUNIT_TEST (firstTest);
+  CPPUNIT_TEST_SUITE_END ();
+
+  public:
+  void setUp (void);
+  void tearDown (void);
+
+  protected:
+  void firstTest (void);
+
+  private:
+  CarobMYSQL *carobMySQL;
+};
+
+#endif
Index: libmysequoia/test/TestMySQLAPI.cpp
diff -u /dev/null libmysequoia/test/TestMySQLAPI.cpp:1.1
--- /dev/null   Mon Dec  5 14:03:37 2005
+++ libmysequoia/test/TestMySQLAPI.cpp  Mon Dec  5 14:03:37 2005
@@ -0,0 +1,39 @@
+/*
+ * Sequoia: Database clustering technology.
+ * Copyright (C) 2005 Continuent, Inc.
+ * Contact: [EMAIL PROTECTED]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Initial developer(s): Zsolt Simon, Csaba Simon
+ * Contributor(s): 
+ */
+
+#include "TestMySQLAPI.hpp"
+
+CPPUNIT_TEST_SUITE_REGISTRATION (TestMySQLAPI);
+
+void TestMySQLAPI::setUp(void)
+{
+  carobMySQL = new CarobMYSQL();
+}
+
+void TestMySQLAPI::tearDown(void) 
+{
+  delete carobMySQL;
+}
+
+void TestMySQLAPI::firstTest(void)
+{
+  CPPUNIT_ASSERT_EQUAL (1 + 1, 2);
+}
Index: libmysequoia/test/TestMySQLAPI.hpp
diff -u /dev/null libmysequoia/test/TestMySQLAPI.hpp:1.1
--- /dev/null   Mon Dec  5 14:03:37 2005
+++ libmysequoia/test/TestMySQLAPI.hpp  Mon Dec  5 14:03:37 2005
@@ -0,0 +1,47 @@
+/*
+ * Sequoia: Database clustering technology.
+ * Copyright (C) 2005 Continuent, Inc.
+ * Contact: [EMAIL PROTECTED]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Initial developer(s): Zsolt Simon, Csaba Simon
+ * Contributor(s): 
+ */
+
+#ifndef _TESTMYSQLAPI_HPP
+#define _TESTMYSQLAPI_HPP
+
+#include "CarobMySQL.hpp"
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+class TestMySQLAPI : public CPPUNIT_NS::TestFixture
+{
+  CPPUNIT_TEST_SUITE (TestMySQLAPI);
+    CPPUNIT_TEST (firstTest);
+  CPPUNIT_TEST_SUITE_END ();
+
+  public:
+  void setUp (void);
+  void tearDown (void);
+
+  protected:
+  void firstTest (void);
+
+  private:
+  CarobMYSQL *carobMySQL;
+};
+
+#endif
Index: libmysequoia/test/runTests.cpp
diff -u /dev/null libmysequoia/test/runTests.cpp:1.1
--- /dev/null   Mon Dec  5 14:03:37 2005
+++ libmysequoia/test/runTests.cpp      Mon Dec  5 14:03:37 2005
@@ -0,0 +1,37 @@
+/*
+ * Sequoia: Database clustering technology.
+ * Copyright (C) 2005 Continuent, Inc.
+ * Contact: [EMAIL PROTECTED]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Initial developer(s): Zsolt Simon, Csaba Simon
+ * Contributor(s): 
+ */
+
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+#include <cppunit/CompilerOutputter.h>
+
+using namespace CPPUNIT_NS;
+
+int main (int argc, char* argv[])
+{
+  TextTestRunner runner;
+
+  runner.addTest(TestFactoryRegistry::getRegistry().makeTest());
+  runner.setOutputter(new CompilerOutputter(&runner.result(), std::cerr));
+
+  return runner.run() ? 0 : 1;
+}
+

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to