diff options
-rw-r--r-- | Repository.mk | 1 | ||||
-rw-r--r-- | compilerplugins/clang/shouldreturnbool.cxx | 3 | ||||
-rw-r--r-- | smoketest/Executable_libtest.mk | 38 | ||||
-rw-r--r-- | smoketest/Module_smoketest.mk | 6 | ||||
-rw-r--r-- | smoketest/libtest.cxx | 160 | ||||
-rw-r--r-- | solenv/clang-format/excludelist | 1 |
6 files changed, 1 insertions, 208 deletions
diff --git a/Repository.mk b/Repository.mk index 08061a692087..d821025277d2 100644 --- a/Repository.mk +++ b/Repository.mk @@ -39,7 +39,6 @@ $(eval $(call gb_Helper_register_executables,NONE, \ idxdict \ langsupport \ $(if $(filter iOS,$(OS)),LibreOffice) \ - libtest \ lngconvex \ localize \ makedepend \ diff --git a/compilerplugins/clang/shouldreturnbool.cxx b/compilerplugins/clang/shouldreturnbool.cxx index 23749d6b6428..1372d8103374 100644 --- a/compilerplugins/clang/shouldreturnbool.cxx +++ b/compilerplugins/clang/shouldreturnbool.cxx @@ -42,8 +42,7 @@ public: if (loplugin::isSamePathname(fn, SRCDIR "/sal/rtl/alloc_cache.cxx")) return; // false +, slightly odd usage, but not wrong - if (loplugin::isSamePathname(fn, SRCDIR "/libreofficekit/qa/tilebench/tilebench.cxx") - || loplugin::isSamePathname(fn, SRCDIR "/smoketest/libtest.cxx")) + if (loplugin::isSamePathname(fn, SRCDIR "/libreofficekit/qa/tilebench/tilebench.cxx")) return; // uses the Unix convention of "non-zero return indicates error" if (loplugin::isSamePathname(fn, SRCDIR "/idlc/source/idlcproduce.cxx")) diff --git a/smoketest/Executable_libtest.mk b/smoketest/Executable_libtest.mk deleted file mode 100644 index c1e33d35e10e..000000000000 --- a/smoketest/Executable_libtest.mk +++ /dev/null @@ -1,38 +0,0 @@ -# -*- 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_Executable_Executable,libtest)) - -$(eval $(call gb_Executable_set_include,libtest,\ - $$(INCLUDE) \ -)) - -ifeq ($(OS),LINUX) -$(eval $(call gb_Executable_add_libs,libtest,\ - -ldl \ -)) -endif - -$(eval $(call gb_Executable_add_exception_objects,libtest,\ - smoketest/libtest \ -)) - -liblibreoffice_OWN_LD_PATH_DIR := $(INSTROOT)/program/libolib -liblibreoffice_OWN_LD_SO := $(liblibreoffice_OWN_LD_PATH_DIR)/$(call gb_Library__get_workdir_linktargetname,libreoffice) - -$(liblibreoffice_OWN_LD_SO) : $(call gb_Library_get_target,libreoffice) - mkdir -p $(liblibreoffice_OWN_LD_PATH_DIR)/Library - cp -a $(call gb_Library_get_target,libreoffice) $(liblibreoffice_OWN_LD_SO) - -run_libtest: $(liblibreoffice_OWN_LD_SO) - $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}":$(liblibreoffice_OWN_LD_PATH_DIR)/Library" \ - $(WORKDIR)/LinkTarget/Executable/libtest \ - $(INSTROOT)/program $(WORKDIR)/Zip/smoketestdoc.sxw \ - -# vim: set noet sw=4 ts=4: diff --git a/smoketest/Module_smoketest.mk b/smoketest/Module_smoketest.mk index 7e8b6d5f11f6..217dbfa6543a 100644 --- a/smoketest/Module_smoketest.mk +++ b/smoketest/Module_smoketest.mk @@ -26,12 +26,6 @@ $(eval $(call gb_Module_add_targets,smoketest,\ endif endif -ifneq ($(filter LINUX WNT,$(OS)),) -$(eval $(call gb_Module_add_check_targets,smoketest,\ - Executable_libtest \ -)) -endif - ifneq (MACOSX/TRUE,$(OS)/$(ENABLE_MACOSX_SANDBOX)) ifneq ($(filter EXTENSIONS,$(BUILD_TYPE)),) $(eval $(call gb_Module_add_subsequentcheck_targets,smoketest,\ diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx deleted file mode 100644 index 7d90a8522353..000000000000 --- a/smoketest/libtest.cxx +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- 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/. - */ - -#include <stdio.h> -#include <string.h> -#include <malloc.h> -#include <assert.h> -#include <math.h> -#include <sal/types.h> - -#include <LibreOfficeKit/LibreOfficeKitInit.h> -#include <LibreOfficeKit/LibreOfficeKit.hxx> -#include <tools/long.hxx> - - -#ifdef _WIN32 -//#include <Windows.h> // come from LibreOfficeKitInit.h - static long getTimeMS() - { - return GetTickCount(); - } - - static bool IsAbsolutePath(char const *pPath) - { - if (pPath[1] != ':') - { - fprintf( stderr, "Absolute path required to libreoffice install\n" ); - return false; - } - - return true; - } - -#else -#include <sys/time.h> - static tools::Long getTimeMS() - { - struct timeval t; - gettimeofday(&t, nullptr); - return t.tv_sec*1000 + t.tv_usec/1000; - } - - static bool IsAbsolutePath(char const *pPath) - { - if (pPath[0] != '/') - { - fprintf( stderr, "Absolute path required to libreoffice install\n" ); - return false; - } - - return true; - } -#endif - - -using namespace ::lok; - - -static int help() -{ - fprintf( stderr, "Usage: libtest <absolute-path-to-libreoffice-install> [path to load document] [path to save document].\n" ); - return 1; -} - -int main (int argc, char **argv) -{ - tools::Long start, end; - - start = getTimeMS(); - - if (argc < 2 || !strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")) - return help(); - - - if( !IsAbsolutePath(argv[1]) ) - return 1; - - // coverity[tainted_string] - build time test tool - char *install_path = argv[1]; - - if( argc > 4 ) - { - fprintf( stderr, "testing preinit\n"); - char *imp_lib; - void *dlhandle; - dlhandle = lok_dlopen( install_path, &imp_lib ); - if( !dlhandle ) - { - fprintf( stderr, "Failed to link '%s'\n", lok_dlerror() ); - return -1; - } - LokHookPreInit *preinit = reinterpret_cast<LokHookPreInit *>(lok_dlsym( dlhandle, "lok_preinit" )); - if( !preinit ) - { - fprintf( stderr, "Failed to find pre-init symbol: %s\n", lok_dlerror() ); - return -1; - } - preinit(install_path, nullptr); - } - - Office *pOffice = lok_cpp_init( install_path ); - if( !pOffice ) - { - fprintf( stderr, "Failed to initialize\n" ); - return -1; - } - - end = getTimeMS(); - fprintf( stderr, "init time: %" SAL_PRIdINT64 " ms\n", sal_Int64(end-start) ); - start = end; - - fprintf( stderr, "start to load document '%s'\n", argv[2] ); - Document *pDocument = pOffice->documentLoad( argv[2] ); - if( !pDocument ) - { - char *pError = pOffice->getError(); - fprintf( stderr, "failed to load document '%s': '%s'\n", - argv[2], pError ); - free (pError); - return -1; - } - - end = getTimeMS(); - fprintf( stderr, "load time: %" SAL_PRIdINT64 " ms\n", sal_Int64(end-start) ); - start = end; - - if( argc > 3 ) - { - const char *pFilter = nullptr; - if( argc > 4 ) - pFilter = argv[4]; - fprintf( stderr, "save document as '%s' (%s)\n", argv[3], pFilter ? pFilter : "<null>" ); - if( !pDocument->saveAs( argv[3], pFilter ) ) - { - char *pError = pOffice->getError(); - fprintf( stderr, "failed to save document '%s'\n", pError); - free (pError); - } - else - { - fprintf( stderr, "Save succeeded\n" ); - end = getTimeMS(); - fprintf( stderr, "save time: %" SAL_PRIdINT64 " ms\n", sal_Int64(end-start) ); - } - } - fprintf( stderr, "all tests passed.\n" ); - - delete pDocument; - delete pOffice; - - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 4d07182a1052..844f96d7f7ad 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -12479,7 +12479,6 @@ slideshow/test/tests.hxx slideshow/test/testshape.cxx slideshow/test/testview.cxx slideshow/test/views.cxx -smoketest/libtest.cxx smoketest/smoketest.cxx solenv/bin/concat-deps.c solenv/gbuildtojson/gbuildtojson.cxx |