diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-14 02:21:27 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-17 09:35:10 +0000 |
commit | 474f5eebb8d86df3384ddecac1452c85524b0c28 (patch) | |
tree | 5e3f1bb64d3cfd1d190ba1a16cd1efeb4f072e41 /solenv/gbuild/platform | |
parent | de3fd5d5378c95504d9c1ef1bedad8746921d2a6 (diff) |
refactor unittest help message
- get platform switch logic out of shell script
- platform specific stuff should be in $(GBUILDDIR)/platform, if
possible
- do not suggest shell-polluting exports, which might lead to confusion
later, suggest setting the var as a one-off addition to the make
command
- move exception caching down, as it is assumed to be used rather
rarely
Change-Id: I01db3ca07582a6c6213ebac86fddabb28c925d50
Reviewed-on: https://gerrit.libreoffice.org/19976
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'solenv/gbuild/platform')
-rw-r--r-- | solenv/gbuild/platform/com_MSC_class.mk | 3 | ||||
-rw-r--r-- | solenv/gbuild/platform/macosx.mk | 3 | ||||
-rwxr-xr-x | solenv/gbuild/platform/unittest-failed-MACOSX.sh | 29 | ||||
-rwxr-xr-x | solenv/gbuild/platform/unittest-failed-WNT.sh | 29 | ||||
-rwxr-xr-x | solenv/gbuild/platform/unittest-failed-default.sh | 30 |
5 files changed, 94 insertions, 0 deletions
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 14febde3a189..41bab51d7f21 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -370,6 +370,8 @@ endef # CppunitTest class +gb_CppunitTest_UNITTESTFAILED := $(GBUILDDIR)/platform/unittest-failed-WNT.sh +gb_CppunitTest_PYTHONDEPS := $(call gb_Package_get_target,python3) gb_CppunitTest_DEFS := -D_DLL ifeq ($(GNUMAKE_WIN_NATIVE),TRUE) gb_CppunitTest_CPPTESTPRECOMMAND := $(call gb_Helper_prepend_ld_path,$(shell cygpath -w $(gb_Library_DLLDIR));$(shell cygpath -w $(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/$(if $(MSVC_USE_DEBUG_RUNTIME),DebugDll,ReleaseDll))) @@ -435,6 +437,7 @@ endef # PythonTest class gb_PythonTest_PRECOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) +gb_PythonTest_DEPS := $(call gb_Package_get_target,python3) # SrsPartTarget class diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 06520626564c..c4285275e526 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -265,6 +265,8 @@ endef # CppunitTest class +gb_CppunitTest_UNITTESTFAILED := $(GBUILDDIR)/platform/unittest-failed-MACOSX.mk +gb_CppunitTest_PYTHONDEPS := $(call gb_Library_get_target,pyuno_wrapper) $(if $(SYSTEM_PYTHON),,$(call gb_GeneratedPackage_get_target,python3)) gb_CppunitTest_CPPTESTPRECOMMAND := \ $(call gb_Helper_extend_ld_path,$(gb_Library_DLLDIR):$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs) gb_CppunitTest_get_filename = libtest_$(1).dylib @@ -299,6 +301,7 @@ endef # PythonTest class +gb_PythonTest_UNITTESTFAILED := $(GBUILDDIR)/platform/unittest-failed-MACOSX.mk gb_PythonTest_PRECOMMAND := $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}$(INSTROOT)/$(LIBO_URE_LIB_FOLDER) ifneq ($(LIBO_LIB_FOLDER),$(LIBO_URE_LIB_FOLDER)) gb_PythonTest_PRECOMMAND := $(gb_PythonTest_PRECOMMAND):$(INSTROOT)/$(LIBO_LIB_FOLDER) diff --git a/solenv/gbuild/platform/unittest-failed-MACOSX.sh b/solenv/gbuild/platform/unittest-failed-MACOSX.sh new file mode 100755 index 000000000000..2a0ebabbc55c --- /dev/null +++ b/solenv/gbuild/platform/unittest-failed-MACOSX.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# -*- Mode: sh; 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/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you 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 . +cat << EOF + +Error: a unit test failed, please do one of: +make $1Test_$2 CPPUNITTRACE="lldb --" # for interactive debugging on OS X +make $1Test_$2 VALGRIND=memcheck # for memory checking + +EOF + +exit 1 + +# vim: set et sw=4: diff --git a/solenv/gbuild/platform/unittest-failed-WNT.sh b/solenv/gbuild/platform/unittest-failed-WNT.sh new file mode 100755 index 000000000000..9ac742bab65a --- /dev/null +++ b/solenv/gbuild/platform/unittest-failed-WNT.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# -*- Mode: sh; 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/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you 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 . +cat << EOF + +Error: a unit test failed, please do one of: +make $1Test_$2 CPPUNITTRACE="'$DEVENV' /debugexe" # for interactive debugging in Visual Studio +make $1Test_$2 CPPUNITTRACE="drmemory -free_max_frames 20" # for memory checking (install Dr.Memory first, and put it to your PATH) + +EOF + +exit 1 + +# vim: set et sw=4: diff --git a/solenv/gbuild/platform/unittest-failed-default.sh b/solenv/gbuild/platform/unittest-failed-default.sh new file mode 100755 index 000000000000..24718fd9ee69 --- /dev/null +++ b/solenv/gbuild/platform/unittest-failed-default.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# -*- Mode: sh; 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/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you 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 . +cat << EOF + +Error: a unit test failed, please do one of: +make $1Test_$2 CPPUNITTRACE="gdb --args" # for interactive debugging on Linux +make $1Test_$2 VALGRIND=memcheck # for memory checking +make $1Test_$2 DEBUGCPPUNIT=TRUE # for exception catching + +EOF + +exit 1 + +# vim: set et sw=4: |