summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-03-05 13:16:36 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-03-12 15:35:33 +0000
commit8887de72c184bec6225a952ec90433ae1b7a5b26 (patch)
treef3d90d221b5eba49aa14ff713c7d11216935b233 /smoketest
parent6ea685090806a2a2f39b8d5ec6a749eaf9b1856e (diff)
liblibo: create initial liblibreoffice.
bootstrap libreoffice, start a dummy test-harness: can't use CppUnit or link to any URE / LibreOffice libraries. Change-Id: I855b640557f93959749e966a2d8e5e577fd84574
Diffstat (limited to 'smoketest')
-rw-r--r--smoketest/CppunitTest_liblibreoffice.mk45
-rw-r--r--smoketest/Module_smoketest.mk4
-rw-r--r--smoketest/libtest.cxx54
3 files changed, 103 insertions, 0 deletions
diff --git a/smoketest/CppunitTest_liblibreoffice.mk b/smoketest/CppunitTest_liblibreoffice.mk
new file mode 100644
index 000000000000..2cd345633d33
--- /dev/null
+++ b/smoketest/CppunitTest_liblibreoffice.mk
@@ -0,0 +1,45 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,liblibreoffice))
+
+$(eval $(call gb_CppunitTest_abort_on_assertion,liblibreoffice))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,liblibreoffice,\
+ smoketest/libtest \
+))
+
+$(eval $(call gb_CppunitTest_use_external,liblibreoffice,boost_headers))
+
+$(eval $(call gb_CppunitTest_use_api,liblibreoffice,\
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,liblibreoffice,\
+ cppu \
+ cppuhelper \
+ libreoffice \
+ sal \
+ unotest \
+))
+
+ifeq ($(OS),MACOSX)
+liblibreoffice_SOFFICE_INST := path:$(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS
+else
+liblibreoffice_SOFFICE_INST := path:$(DEVINSTALLDIR)/opt/program
+endif
+
+$(eval $(call gb_CppunitTest_use_ure,liblibreoffice))
+
+$(eval $(call gb_CppunitTest_add_arguments,liblibreoffice,\
+ -env:arg-soffice=$(liblibreoffice_SOFFICE_INST) \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/smoketest/Module_smoketest.mk b/smoketest/Module_smoketest.mk
index 9de8a445ae9e..9a2aa72f9fc3 100644
--- a/smoketest/Module_smoketest.mk
+++ b/smoketest/Module_smoketest.mk
@@ -42,6 +42,10 @@ $(eval $(call gb_Module_add_targets,smoketest,\
))
endif
+$(eval $(call gb_Module_add_check_targets,smoketest,\
+ CppunitTest_liblibreoffice \
+))
+
$(eval $(call gb_Module_add_subsequentcheck_targets,smoketest,\
CppunitTest_smoketest \
))
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx
new file mode 100644
index 000000000000..39ab01bb2cf6
--- /dev/null
+++ b/smoketest/libtest.cxx
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+// yuck / FIXME ...
+#include "../desktop/inc/liblibreoffice.h"
+
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+#include <rtl/bootstrap.hxx>
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+
+class Test: public CppUnit::TestFixture {
+public:
+ virtual void setUp();
+ virtual void tearDown();
+
+private:
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(test);
+ CPPUNIT_TEST_SUITE_END();
+
+ void test();
+};
+
+void Test::setUp()
+{
+}
+void Test::tearDown()
+{
+}
+
+void Test::test()
+{
+ rtl::OUString aArgSoffice;
+ rtl::Bootstrap::get( rtl::OUString( "arg-soffice" ), aArgSoffice );
+ OString aInstall = OUStringToOString( aArgSoffice, RTL_TEXTENCODING_UTF8 );
+ fprintf( stderr, "liblibreoffice test: '%s'\n", aInstall.getStr() );
+ lo_initialize( aInstall.getStr() );
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */