[gnome-keyring] tap-gtester: Set the HARNESS_ACTIVE environment variable



commit 6210ba499e0df2341a1660c35d6c9c2c74611c8b
Author: Stef Walter <stefw gnome org>
Date:   Wed Mar 5 18:10:30 2014 +0100

    tap-gtester: Set the HARNESS_ACTIVE environment variable
    
    This allows tests to detect whether they're running under a harness
    or not.
    
    In addition handle the way GTests skips better.

 build/tap-gtester |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/build/tap-gtester b/build/tap-gtester
index ff7506a..7e667d4 100755
--- a/build/tap-gtester
+++ b/build/tap-gtester
@@ -74,10 +74,11 @@ class GTestCompiler(NullCompiler):
                self.test_remaining.remove(self.test_name)
                self.test_num += 1
            elif cmd == "result":
-               if data == "OK":
-                   print "ok %d %s" % (self.test_num, self.test_name)
-               if data == "FAIL":
-                   print "not ok %d %s", (self.test_num, self.test_name)
+               if self.test_name:
+                   if data == "OK":
+                       print "ok %d %s" % (self.test_num, self.test_name)
+                   if data == "FAIL":
+                       print "not ok %d %s", (self.test_num, self.test_name)
                self.test_name = None
            elif cmd == "skipping":
                if "/subprocess" not in data:
@@ -151,6 +152,8 @@ def main(argv):
     cmd = args.command
     proc = None
 
+    os.environ['HARNESS_ACTIVE'] = '1'
+
     if format in ["auto", "gtest"]:
         list_cmd = cmd + ["-l", "--verbose"]
         proc = subprocess.Popen(list_cmd, close_fds=True, stdout=subprocess.PIPE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]