Kaydet (Commit) b5e988ff authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

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
üst 62c2022b
#!/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:
......@@ -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)))
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment