commit:     41442dc25c6fe59858376c9c6964215341237bc4
Author:     Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
AuthorDate: Fri Dec 20 14:30:10 2019 +0000
Commit:     Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
CommitDate: Fri Dec 20 19:56:45 2019 +0000
URL:        https://gitweb.gentoo.org/proj/tatt.git/commit/?id=41442dc2

add a return code to the use test script

Signed-off-by: Rolf Eike Beer <eike <AT> sf-mail.de>

 tatt/scriptwriter.py        | 3 +++
 templates/tatt_functions.sh | 1 +
 templates/use-footer        | 2 ++
 templates/use-header        | 2 ++
 templates/use-snippet       | 2 +-
 templates/use-test-snippet  | 2 +-
 6 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tatt/scriptwriter.py b/tatt/scriptwriter.py
index fa26608..b4bee69 100644
--- a/tatt/scriptwriter.py
+++ b/tatt/scriptwriter.py
@@ -84,6 +84,9 @@ def writeusecombiscript(job, config):
         loop = useloop.replace("@@LOOP_BODY@@", useCombiTestString(job, p, 
config, port))
         loop = loop.replace("@@CPV@@", p.packageString())
         outfile.write(loop)
+    if os.path.exists(config['template-dir'] + "use-footer"):
+        footer = scriptTemplate(job, config, "use-footer")
+        outfile.write(footer)
     # Note: fchmod needs the filedescriptor which is an internal
     # integer retrieved by fileno().
     os.fchmod(outfile.fileno(), 0o744)  # rwxr--r--

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index 92db9ba..d2b5bc8 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -63,5 +63,6 @@ function tatt_test_pkg
     echo "USE='${USE}' succeeded for ${1:?}" >> "${TATT_REPORTFILE}"
   else
     FEATURES="${TFEATURES}" tatt_pkg_error "${1:?}" "${eout}"
+    return 1
   fi
 }

diff --git a/templates/use-footer b/templates/use-footer
new file mode 100644
index 0000000..90349dc
--- /dev/null
+++ b/templates/use-footer
@@ -0,0 +1,2 @@
+
+exit ${test_ret}

diff --git a/templates/use-header b/templates/use-header
index d18e080..9ae0cdb 100644
--- a/templates/use-header
+++ b/templates/use-header
@@ -11,3 +11,5 @@ export TATT_EMERGEOPTS="@@EMERGEOPTS@@"
 source "@@TEMPLATEDIR@@tatt_functions.sh"
 
 echo -e "USE tests started on $(date)\n" >> @@REPORTFILE@@
+
+test_ret=0

diff --git a/templates/use-snippet b/templates/use-snippet
index 50427ba..7404452 100644
--- a/templates/use-snippet
+++ b/templates/use-snippet
@@ -1 +1 @@
-@@USE@@ tatt_test_pkg "@@CPV@@"
+@@USE@@ tatt_test_pkg "@@CPV@@" || test_ret=1

diff --git a/templates/use-test-snippet b/templates/use-test-snippet
index ca99034..7a5a8a9 100644
--- a/templates/use-test-snippet
+++ b/templates/use-test-snippet
@@ -1 +1 @@
-@@USE@@ tatt_test_pkg --test "@@CPV@@"
+@@USE@@ tatt_test_pkg --test "@@CPV@@" || test_ret=1

Reply via email to