From Peter Wu: on systems other than Windows, skip the GUI tests if the
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 22 Sep 2013 21:51:05 +0000 (21:51 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 22 Sep 2013 21:51:05 +0000 (21:51 +0000)
DISPLAY environment variable isn't set.

From me: note that this won't be the right thing to do on OS X if we
switch to a toolkit that doesn't use X11, and that this may or may not
be the right thing to do with toolkits using Wayland or Mir directly.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@52182 f5534014-38df-0310-8fa8-9805f1628bb7

test/README.test
test/suite-capture.sh

index 10411dbb4d65e8cf60f772c3298e526079f43217..a3bb51076fa11e47085e9a63ded0e42186c5c57f 100644 (file)
@@ -41,7 +41,9 @@ What you'll need (to do):
  - have tput (e.g. in the cygwin ncurses package)
  - you'll need a network interface with some network traffic 
    (so you can run the capture tests)
+ - (for non-Windows platforms) An X server for running the capture tests with
+   the graphical Wireshark program.
+
 A Test Ride
 -----------
 
index 1a7b4f2bdf6e2016f0259fd15ce1986c12d40ad2..773b73b039e5b25db4162f085dc265f3de4b50b0 100755 (executable)
@@ -413,6 +413,23 @@ capture_step_snapshot() {
 wireshark_capture_suite() {
        # k: start capture immediately
        # WIRESHARK_QUIT_AFTER_CAPTURE needs to be set.
+
+       #
+       # NOTE: if, on OS X, we start using a native-Quartz toolkit,
+       # this would need to change to check for WS_SYSTEM being
+       # "Darwin" and, if it is, check whether the standard output
+       # of "launchctl managername" is "Aqua".
+       #
+       # This may not do the right thing if we use toolkits that
+       # use Wayland or Mir directly, unless they also depend on
+       # the DISPLAY environment variable.
+       #
+       if [[ $WS_SYSTEM != Windows ]] && [ -z "$DISPLAY" ]; then
+               echo -n ' (X server not available)'
+               test_step_skipped
+               return
+       fi
+
        DUT="$WIRESHARK_CMD"
        test_step_add "Capture 10 packets" capture_step_10packets
        # piping to stdout doesn't work with Wireshark and capturing!