GNOME Bugzilla – Bug 724859
Let the test_wait_until() test also run on non-*nix
Last modified: 2014-03-05 14:06:30 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!
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)?
the most trivial fix would be to run the actual test under g_test_trap_subprocess(), which lets you pass a timeout
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!
Hi, pinging here... Any comments and suggestions on this part? With blessings, thank you!
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.
Attachment 270989 [details] pushed as c9cda16 - cond test: remove alarm() usage Sorry for the delay. Fixed!