X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-timeval.c;h=9896cf7372ff880b8af487c3819e47ee69c36c7b;hb=e892d5ffb5749c0534fecd903e3e6a76819f1346;hp=442b27af6cd0fc90a6afc73839c86049af935d2c;hpb=279c9e030818e039bb1c26be76e2cc1e8f6b13a6;p=sliver-openvswitch.git diff --git a/tests/test-timeval.c b/tests/test-timeval.c index 442b27af6..9896cf737 100644 --- a/tests/test-timeval.c +++ b/tests/test-timeval.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011 Nicira Networks. + * Copyright (c) 2009, 2010, 2011 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,6 +97,12 @@ main(int argc, char *argv[]) if (argc != 2) { usage(); } else if (!strcmp(argv[1], "plain")) { + /* If we're not caching time there isn't much to test and SIGALRM won't + * be around to pull us out of the select() call, so just skip out */ + if (!CACHE_TIME) { + exit (77); + } + do_test(); } else if (!strcmp(argv[1], "daemon")) { /* Test that time still advances even in a daemon. This is an @@ -104,6 +110,10 @@ main(int argc, char *argv[]) char cwd[1024], *pidfile; FILE *success; + if (!CACHE_TIME) { + exit (77); + } + assert(getcwd(cwd, sizeof cwd) == cwd); unlink("test-timeval.success");