[gjs] tests: Allow disabling abort timeout



commit 6d22836cb4e95c6608ca19af03998ad3582df4b9
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Nov 28 23:43:05 2016 -0800

    tests: Allow disabling abort timeout
    
    Run tests under GDB with GJS_TEST_SKIP_TIMEOUT=1 so that you don't get
    SIGABRT while stepping through the program.
    
    Original idea by Havoc Pennington <hp pobox com>.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=605972

 test/gjs-tests.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/test/gjs-tests.cpp b/test/gjs-tests.cpp
index 17251b3..47559b1 100644
--- a/test/gjs-tests.cpp
+++ b/test/gjs-tests.cpp
@@ -215,7 +215,10 @@ int
 main(int    argc,
      char **argv)
 {
-    gjs_crash_after_timeout(60*7); /* give the unit tests 7 minutes to complete */
+    /* give the unit tests 7 minutes to complete, unless an environment variable
+     * is set; use this when running under GDB, for example */
+    if (!g_getenv("GJS_TEST_SKIP_TIMEOUT"))
+        gjs_crash_after_timeout(60 * 7);
 
     g_test_init(&argc, &argv, NULL);
 


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