diff options
author | Guido van Rossum <guido@python.org> | 1997-01-03 22:42:08 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-01-03 22:42:08 (GMT) |
commit | 9d1a02ce335be34d31274797ce3d53012e28e22b (patch) | |
tree | e764f83b1dac01a52518e63466370cfe0678223c /Lib/test/test_gl.py | |
parent | a2a8b27221744428da08e591f6e4c5540f9cd408 (diff) | |
download | cpython-9d1a02ce335be34d31274797ce3d53012e28e22b.zip cpython-9d1a02ce335be34d31274797ce3d53012e28e22b.tar.gz cpython-9d1a02ce335be34d31274797ce3d53012e28e22b.tar.bz2 |
Some small changes.
Raise ImportError instead of SystemExit when $DISPLAY is not set, so
regrtest.py will do the right thing.
Add a call to gl.clear() to clear the window before drawing in it.
Add some verbose prints for completeness.
Use gl.v2i() for the coordinates of one of the lines, for a little bit
of variety.
Reduce the time the window is displayed from 5 to 2 seconds.
Diffstat (limited to 'Lib/test/test_gl.py')
-rwxr-xr-x | Lib/test/test_gl.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Lib/test/test_gl.py b/Lib/test/test_gl.py index 7e9c31c..d4e4d28 100755 --- a/Lib/test/test_gl.py +++ b/Lib/test/test_gl.py @@ -87,7 +87,8 @@ def main(): try: display = os.environ['DISPLAY'] except: - raise SystemExit + # Raise ImportError because regrtest.py handles it specially. + raise ImportError, "No $DISPLAY -- skipping gl test" # touch all the attributes of gl without doing anything if verbose: @@ -109,6 +110,9 @@ def main(): print 'winopen "CrissCross"' w = gl.winopen('CrissCross') if verbose: + print 'clear' + gl.clear() + if verbose: print 'ortho2' gl.ortho2(0.0, 400.0, 0.0, 400.0) if verbose: @@ -130,12 +134,18 @@ def main(): if verbose: print 'bgnline' gl.bgnline() - gl.v2f(400.0, 0.0) - gl.v2f(0.0, 400.0) if verbose: - print 'Displaying window for 5 seconds...' + print 'v2i' + gl.v2i(400, 0) + gl.v2i(0, 400) + if verbose: + print 'endline' gl.endline() - time.sleep(5) + if verbose: + print 'Displaying window for 2 seconds...' + time.sleep(2) + if verbose: + print 'winclose' gl.winclose(w) main() |