# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1301573234 7200
# Node ID 503e34189f14cc54a8c5f55717fba5d3350b9f4c
# Parent 2a119871afcfdd138620ae813ed3549994971ea4
#11100: Increase default timeout of test_executable() to 50 seconds
diff r 2a119871afcf r 503e34189f14 sage/tests/cmdline.py
a

b


38  38  from subprocess import * 
39  39  import os, select 
40  40  
41   def test_executable(args, input="", timeout=10.0): 
 41  def test_executable(args, input="", timeout=50.0): 
42  42  """ 
43  43  Run the program defined by ``args`` using the string ``input`` on 
44  44  the standard input. 
… 
… 

71  71  
72  72  We test the timeout option:: 
73  73  
74   sage: (out, err, ret) = test_executable(["sleep", "1"], "", 0.1) 
 74  sage: (out, err, ret) = test_executable(["sleep", "1"], timeout=0.1) 
75  75  Traceback (most recent call last): 
76  76  ... 
77  77  RuntimeError: timeout in test_executable() 
78  78  
79  79  TESTS:: 
80  80  
81   sage: (out, err, ret) = test_executable(["sage"], timeout=50) 
 81  sage: (out, err, ret) = test_executable(["sage"]) 
82  82  sage: out.find(version()) >= 0 
83  83  True 
84  84  sage: err 
… 
… 

86  86  sage: ret 
87  87  0 
88  88  
89   sage: (out, err, ret) = test_executable(["sage"], "3^33\n", timeout=50) 
 89  sage: (out, err, ret) = test_executable(["sage"], "3^33\n") 
90  90  sage: out.find(version()) >= 0 
91  91  True 
92  92  sage: out.find("5559060566555523") >= 0 
… 
… 

96  96  sage: ret 
97  97  0 
98  98  
99   sage: (out, err, ret) = test_executable(["sage", "q"], "3^33\n", timeout=50) 
 99  sage: (out, err, ret) = test_executable(["sage", "q"], "3^33\n") 
100  100  sage: out.find(version()) >= 0 
101  101  False 
102  102  sage: out.find("5559060566555523") >= 0 
… 
… 

106  106  sage: ret 
107  107  0 
108  108  
109   sage: (out, err, ret) = test_executable(["sage", "c", "print 3^33"], timeout=50) 
 109  sage: (out, err, ret) = test_executable(["sage", "c", "print 3^33"]) 
110  110  sage: out.find("5559060566555523\n") >= 0 
111  111  True 
112  112  sage: err 
… 
… 

114  114  sage: ret 
115  115  0 
116  116  
117   sage: (out, err, ret) = test_executable(["sage", "min", "c", "print 3^33"], timeout=50) 
 117  sage: (out, err, ret) = test_executable(["sage", "min", "c", "print 3^33"]) 
118  118  sage: out.find("5559060566555523\n") >= 0 
119  119  True 
120  120  sage: err 
… 
… 

170  170  sage: ret 
171  171  0 
172  172  
173   sage: (out, err, ret) = test_executable(["sage", "startuptime"], timeout=50) 
 173  sage: (out, err, ret) = test_executable(["sage", "startuptime"]) 
174  174  sage: out.find("sage.all: ") >= 0 
175  175  True 
176  176  sage: err 