After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724859 - Let the test_wait_until() test also run on non-*nix
Let the test_wait_until() test also run on non-*nix
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.39.x
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-02-21 09:16 UTC by Fan, Chun-wei
Modified: 2014-03-05 14:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Build the test_wait_until() test on *nix only (1.25 KB, patch)
2014-02-21 09:16 UTC, Fan, Chun-wei
rejected Details | Review
glib/tests/cond.c: Fix build on non-*nix by using g_test_trap_subprocess() (1.93 KB, patch)
2014-02-25 10:34 UTC, Fan, Chun-wei
none Details | Review
cond test: remove alarm() usage (1015 bytes, patch)
2014-03-05 14:05 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Fan, Chun-wei 2014-02-21 09:16:35 UTC
Created attachment 269876 [details] [review]
Build the test_wait_until() test on *nix only

Hi,

There was a recently-added test to glib/tests/cond.c, test_wait_until(), that seems to be for *nix only, as it made use of alarm(), which is not available at least on Windows.  This fixes the build of the test on Windows by conditionally compiling the test.  Please advise if a workaround for Windows is preferred though.

With blessings, thank you!
Comment 1 Allison Karlitskaya (desrt) 2014-02-21 12:54:03 UTC
Review of attachment 269876 [details] [review]:

I'd actually prefer to run this test on Windows, due to its different implementation of both monotonic time and condition variables.  Could we find something else to use than alarm() (or just #ifdef out this one part of the function)?
Comment 2 Dan Winship 2014-02-21 13:44:49 UTC
the most trivial fix would be to run the actual test under g_test_trap_subprocess(), which lets you pass a timeout
Comment 3 Fan, Chun-wei 2014-02-25 10:34:00 UTC
Created attachment 270243 [details] [review]
glib/tests/cond.c: Fix build on non-*nix by using g_test_trap_subprocess()

Hi,

According to Dan's suggestion, here's my patch to use g_test_trap_subprocess() for the test, so that it will run also on non-*nix-I hope I understood its usage here right.

Thank you, with blessings!
Comment 4 Fan, Chun-wei 2014-03-05 07:57:08 UTC
Hi, pinging here...

Any comments and suggestions on this part?

With blessings, thank you!
Comment 5 Allison Karlitskaya (desrt) 2014-03-05 14:05:27 UTC
Created attachment 270989 [details] [review]
cond test: remove alarm() usage

This means that the test can't build on Windows (and we do want it there).

This will be properly resolved with bug 725266, but let's not block the
build before then.
Comment 6 Allison Karlitskaya (desrt) 2014-03-05 14:06:26 UTC
Attachment 270989 [details] pushed as c9cda16 - cond test: remove alarm() usage

Sorry for the delay.  Fixed!