diff options
author | Bastien Nocera <hadess@hadess.net> | 2017-01-17 12:02:50 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2017-01-25 17:18:21 +0100 |
commit | 957db0e6231178cbf4c2fef7dc2467c3ff19d923 (patch) | |
tree | e75db337aa0f321aaf7a281fd93ca3a2a1a62a75 /tests | |
parent | 5fa56454045e972770860dd924d3171057883200 (diff) | |
download | gnome-settings-daemon-957db0e6231178cbf4c2fef7dc2467c3ff19d923.tar.gz |
tests: Use Xvfb instead of Xorg + dummy plugin
It's easier to setup for our purpose, and now supports XRandR since
support got merged in December 2015.
See https://bugs.freedesktop.org/show_bug.cgi?id=26391
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/gsdtestcase.py | 26 | ||||
-rw-r--r-- | tests/xorg-dummy.conf | 4 |
3 files changed, 5 insertions, 26 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 1e83344d..da78a69d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,5 +8,4 @@ EXTRA_DIST = \ gsdtestcase.py \ dummy.session \ dummyapp.desktop \ - xorg-dummy.conf \ $(NULL) diff --git a/tests/gsdtestcase.py b/tests/gsdtestcase.py index 4dec7b2e..ed0a0a07 100644 --- a/tests/gsdtestcase.py +++ b/tests/gsdtestcase.py @@ -201,32 +201,17 @@ class GSDTestCase(dbusmock.DBusTestCase): @classmethod def start_xorg(klass): - '''start X.org server with dummy driver''' - - conf = os.path.join(os.path.dirname(__file__), 'xorg-dummy.conf') - - # some distros like Fedora install Xorg as suid root; copy it into our - # workdir to drop the suid bit and run it as user - if GLib.file_test('/usr/libexec/Xorg.bin', GLib.FileTest.IS_EXECUTABLE): - xorg = '/usr/libexec/Xorg.bin' - else: - out = GLib.find_program_in_path ('Xorg') - if not out: - sys.stderr.write('ERROR: Xorg not installed\n') - sys.exit(1) - xorg = os.path.join(klass.workdir, 'Xorg') - shutil.copy(out, xorg) + '''start Xvfb server''' + xorg = GLib.find_program_in_path ('Xvfb') display_num = 99 if os.path.isfile('/tmp/.X%d-lock' % display_num): sys.stderr.write('Cannot start X.org, an instance already exists\n') sys.exit(1) - # You can rename the log file to *.log if you want to see it on test - # case failures - log = os.path.join(klass.workdir, 'Xorg.out') - klass.xorg = subprocess.Popen([xorg, '-config', conf, '-logfile', log, ':%d' % display_num], + # Composite extension won't load unless at least 24bpp is set + klass.xorg = subprocess.Popen([xorg, ':%d' % display_num, "-screen", "0", "1280x1024x24", "+extension", "GLX"], stderr=subprocess.PIPE) os.environ['DISPLAY'] = ':%d' % display_num @@ -243,8 +228,7 @@ class GSDTestCase(dbusmock.DBusTestCase): stderr=subprocess.PIPE) == 0: break if timeout <= 0: - with open(log) as f: - sys.stderr.write('Cannot start X.org with dummy driver. Log:\n%s\n--------' % f.read()) + sys.stderr.write('Cannot start Xvfb.\n--------') sys.exit(1) @classmethod diff --git a/tests/xorg-dummy.conf b/tests/xorg-dummy.conf deleted file mode 100644 index 0fc61880..00000000 --- a/tests/xorg-dummy.conf +++ /dev/null @@ -1,4 +0,0 @@ -Section "Device" - Identifier "test" - Driver "dummy" -EndSection |