commit:     b016e3fcd2efdb8c70d6ee8d53f63f729d5ba916
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  7 12:31:32 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Mon Dec  7 12:32:29 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b016e3fc

virtualx.eclass: Add verbose warning about nonfatal call

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=517976

Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 eclass/virtualx.eclass | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 8a6ee88..db1ecfa 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -111,6 +111,16 @@ virtualmake() {
 # @DESCRIPTION:
 # Start new Xvfb session and run commands in it.
 #
+# IMPORTANT: The command is run nonfatal !!!
+#
+# This means we are checking for the return code and raise an exception if it
+# isn't 0. So you need to make sure that all commands return a proper
+# code and not just die. All eclass function used should support nonfatal
+# calls properly.
+#
+# The rational behind this is the tear down of the started Xfvb session. A
+# straight die would leave a running session behind.
+#
 # Example:
 #
 # @CODE
@@ -124,6 +134,17 @@ virtualmake() {
 #      virtx py.test --verbose
 # }
 # @CODE
+#
+# @CODE
+# my_test() {
+#   some_command
+#   return $?
+# }
+#
+# src_test() {
+#   virtx my_test
+# }
+# @CODE
 virtx() {
        debug-print-function ${FUNCNAME} "$@"
 

Reply via email to