diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-01-23 12:51:38 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-01-23 12:55:09 +0100 |
commit | b5e988ffc121147c052cf9d6992afc35db3df49b (patch) | |
tree | a53aa6530614fa683b2d236c230b8ffdd73146ee | |
parent | 62c2022ba73b165072e0bf01f7f368f0ecda9aad (diff) |
make unittest failure foo a script
- first of all, code from CppunitTest.mk used from PythonTest.mk is bad
anyway
- also, this shortens and removes noise from the commandline executed
Change-Id: I6c5b41a0c497b766c3293aeec5c59240aa3ef37c
-rwxr-xr-x | solenv/bin/unittest-failed.sh | 23 | ||||
-rw-r--r-- | solenv/gbuild/CppunitTest.mk | 9 | ||||
-rw-r--r-- | solenv/gbuild/PythonTest.mk | 4 |
3 files changed, 26 insertions, 10 deletions
diff --git a/solenv/bin/unittest-failed.sh b/solenv/bin/unittest-failed.sh new file mode 100755 index 000000000000..35db6dc3b058 --- /dev/null +++ b/solenv/bin/unittest-failed.sh @@ -0,0 +1,23 @@ +#!/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 . + +printf '\nError: a unit test failed, please do one of:\n\nexport DEBUGCPPUNIT=TRUE # for exception catching\nexport CPPUNITTRACE="gdb --args" # for interactive debugging on linux\nexport CPPUNITTRACE="\"[full path to devenv.exe]\" /debugexe" # for interactive debugging in Visual Studio\nexport VALGRIND=memcheck # for memory checking\n\nand retry using: make %sTest_%s\n\n' $1 $2 +exit 1 + +# vim: set et sw=4: diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index b2c268ddeaf7..ba3ddac11570 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -17,15 +17,8 @@ # the License at http://www.apache.org/licenses/LICENSE-2.0 . # - # CppunitTest class -# $(1): "Cppunit" or "Python" -# $(2): the name of the unit test that failed -define gb_UNIT_FAILED_MSG -printf '\nError: a unit test failed, please do one of:\n\nexport DEBUGCPPUNIT=TRUE # for exception catching\nexport CPPUNITTRACE="gdb --args" # for interactive debugging on linux\nexport CPPUNITTRACE="\"[full path to devenv.exe]\" /debugexe" # for interactive debugging in Visual Studio\nexport VALGRIND=memcheck # for memory checking\n\nand retry using: make %sTest_%s\n\n' $(1) $(2) -endef - ifeq ($(strip $(DEBUGCPPUNIT)),TRUE) gb_CppunitTest_GDBTRACE := gdb -nx -ex "add-auto-load-safe-path $(INSTDIR)" --command=$(SRCDIR)/solenv/bin/gdbtrycatchtrace-stdout -return-child-result --args else ifneq ($(strip $(CPPUNITTRACE)),) @@ -96,7 +89,7 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS) || ($(if $(value gb_CppunitTest_postprocess), \ RET=$$?; \ $(call gb_CppunitTest_postprocess,$(gb_CppunitTest_CPPTESTCOMMAND),$@.core,$$RET) >> $@.log 2>&1;) \ - cat $@.log; $(call gb_UNIT_FAILED_MSG,Cppunit,$*); false)))) + cat $@.log; $(SRCDIR)/solenv/bin/unittest-failed.sh Cppunit $*)))) define gb_CppunitTest_CppunitTest $(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest_get_linktarget,$(1))) diff --git a/solenv/gbuild/PythonTest.mk b/solenv/gbuild/PythonTest.mk index 45d217f78ef7..76af68ea4edf 100644 --- a/solenv/gbuild/PythonTest.mk +++ b/solenv/gbuild/PythonTest.mk @@ -51,10 +51,10 @@ $(call gb_PythonTest_get_target,%) : $(MODULES) \ $(if $(gb_CppunitTest__interactive),, \ > $@.log 2>&1 \ - || (cat $@.log && $(call gb_UNIT_FAILED_MSG,Python,$*) \ + || (cat $@.log \ $(if $(value gb_CppunitTest_postprocess), \ && $(call gb_CppunitTest_postprocess,$(gb_PythonTest_EXECUTABLE_GDB),$@.core,139)) \ - && false)))) + && $(SRCDIR)/solenv/bin/unittest-failed.sh Python $*)))) # always use udkapi and URE services define gb_PythonTest_PythonTest |