patch 8.2.3526: tests have clumsy check for X11 based GUI

Problem:    Tests have clumsy check for X11 based GUI.
Solution:   Add CheckX11BasedGui.
diff --git a/src/testdir/check.vim b/src/testdir/check.vim
index 6d2d564..55a64bd 100644
--- a/src/testdir/check.vim
+++ b/src/testdir/check.vim
@@ -217,6 +217,14 @@
   endif
 endfunc
 
+" Command to check for X11 based GUI
+command CheckX11BasedGui call CheckX11BasedGui()
+func CheckX11BasedGui()
+  if !g:x11_based_gui
+    throw 'Skipped: requires X11 based GUI'
+  endif
+endfunc
+
 " Command to check for satisfying any of the conditions.
 " e.g. CheckAnyOf Feature:bsd Feature:sun Linux
 command -nargs=+ CheckAnyOf call CheckAnyOf(<f-args>)