File 0001-disable-timeout-test-on-slow-buildsystems.patch of Package libssh

Index: libssh-0.8.2/tests/unittests/torture_misc.c
===================================================================
--- libssh-0.8.2.orig/tests/unittests/torture_misc.c	2018-08-30 08:12:50.355846083 +0200
+++ libssh-0.8.2/tests/unittests/torture_misc.c	2018-08-30 08:12:54.831889573 +0200
@@ -197,11 +197,13 @@ static void torture_timeout_elapsed(void
     (void) state;
     ssh_timestamp_init(&ts);
     usleep(50000);
+#ifndef SLOW_TEST_SYSTEM
     assert_true(ssh_timeout_elapsed(&ts,25));
     assert_false(ssh_timeout_elapsed(&ts,30000));
     assert_false(ssh_timeout_elapsed(&ts,75));
     assert_true(ssh_timeout_elapsed(&ts,0));
     assert_false(ssh_timeout_elapsed(&ts,-1));
+#endif /* SLOW_TEST_SYSTEM */
 }
 
 static void torture_timeout_update(void **state){
@@ -209,11 +211,13 @@ static void torture_timeout_update(void
     (void) state;
     ssh_timestamp_init(&ts);
     usleep(50000);
+#ifndef SLOW_TEST_SYSTEM
     assert_int_equal(ssh_timeout_update(&ts,25), 0);
     assert_in_range(ssh_timeout_update(&ts,30000),29000,29960);
     assert_in_range(ssh_timeout_update(&ts,75),1,40);
     assert_int_equal(ssh_timeout_update(&ts,0),0);
     assert_int_equal(ssh_timeout_update(&ts,-1),-1);
+#endif /* SLOW_TEST_SYSTEM */
 }
 
 static void torture_ssh_analyze_banner(void **state) {
Index: libssh-0.8.2/DefineOptions.cmake
===================================================================
--- libssh-0.8.2.orig/DefineOptions.cmake	2018-08-30 08:12:50.355846083 +0200
+++ libssh-0.8.2/DefineOptions.cmake	2018-08-30 08:13:25.020182668 +0200
@@ -20,6 +20,7 @@ option(WITH_SYMBOL_VERSIONING "Build wit
 option(WITH_ABI_BREAK "Allow ABI break" OFF)
 option(FUZZ_TESTING "Build with fuzzer for the server" OFF)
 option(PICKY_DEVELOPER "Build with picky developer flags" OFF)
+option(SLOW_TEST_SYSTEM "Disable tests that fail on slow systems" OFF)
 
 if (WITH_ZLIB)
     set(WITH_LIBZ ON)
@@ -46,3 +47,8 @@ endif (WITH_NACL)
 if (WITH_ABI_BREAK)
   set(WITH_SYMBOL_VERSIONING ON)
 endif (WITH_ABI_BREAK)
+
+if (SLOW_TEST_SYSTEM)
+  set (SLOW_TEST_SYSTEM ON)
+  add_definitions(-DSLOW_TEST_SYSTEM)
+endif (SLOW_TEST_SYSTEM)
openSUSE Build Service is sponsored by