Bug 92887

Summary: test-fdpass returns error although all tests are skipped on windows
Product: dbus Reporter: Ralf Habacker <ralf.habacker>
Component: coreAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: D-Bus Maintainers <dbus>
Severity: normal    
Priority: medium Keywords: patch
Version: 1.10   
Hardware: Other   
OS: Windows (All)   
Whiteboard: review? 1.10
i915 platform: i915 features:
Attachments: fdpass test: assert that TCP connections don't say they can pass fds

Description Ralf Habacker 2015-11-10 10:14:34 UTC
Running test-fdpass on windows skips all tests because fd passing is not supported.

/relay: SKIP
/limit: SKIP
/too-many/plus1: SKIP
/too-many/plus2: SKIP
/too-many/plus17: SKIP
/too-many/split: SKIP
/flood/1: SKIP
/flood/half-limit: SKIP
/flood/over-half-limit: SKIP
/flood/limit: SKIP
/odd-limit/minus1: SKIP
/odd-limit/at: SKIP
/odd-limit/plus1: SKIP
/odd-limit/plus2: SKIP

Unfortunally it returns an exit code of 77, which is indicated as error by ctest.

      Start  9: test-fdpass
 8/15 Test  #9: test-fdpass ......................***Failed    0.05 sec
Comment 1 Simon McVittie 2015-11-17 13:15:09 UTC
(In reply to Ralf Habacker from comment #0)
> Running test-fdpass on windows skips all tests because fd passing is not
> supported.
...
> Unfortunally it returns an exit code of 77, which is indicated as error by
> ctest.

Exit code 77 is special for Automake, which treats it as "the whole test was skipped". GLib's test framework produces Automake-compatible exit codes. I can't find an equivalent in CMake's documentation, unfortunately. We can work around this by making sure there is one test that will not be skipped, even on Windows.

I notice that we don't have a test that says "if we open a TCP connection, it does not claim that it can pass fds", which seems like something that might be useful to test. That would pass on both Windows and Unix.
Comment 2 Simon McVittie 2015-11-17 13:24:00 UTC
Created attachment 119734 [details] [review]
fdpass test: assert that TCP connections don't say they can  pass fds

As well as slightly increasing our test coverage, this ensures
that at least one test-case in this test is not skipped, working
around CMake's lack of support for the Automake-style exit code
produced by GTest executables (they exit 77 if everything was skipped).
Comment 3 Ralf Habacker 2015-11-17 13:41:39 UTC
Comment on attachment 119734 [details] [review]
fdpass test: assert that TCP connections don't say they can  pass fds

Review of attachment 119734 [details] [review]:
-----------------------------------------------------------------

Did run on windows.

bin/test-fdpass.exe ; echo $?
/unsupported: OK
/relay: SKIP
/limit: SKIP
/too-many/plus1: SKIP
/too-many/plus2: SKIP
/too-many/plus17: SKIP
/too-many/split: SKIP
/flood/1: SKIP
/flood/half-limit: SKIP
/flood/over-half-limit: SKIP
/flood/limit: SKIP
/odd-limit/minus1: SKIP
/odd-limit/at: SKIP
/odd-limit/plus1: SKIP
/odd-limit/plus2: SKIP
0

looks good.
Comment 4 Ralf Habacker 2015-11-17 13:49:07 UTC
Comment on attachment 119734 [details] [review]
fdpass test: assert that TCP connections don't say they can  pass fds

committed to dbus-1.10

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.