From: Damien Lespiau <damien.lespiau@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/4] lib: Factor out a function to check if an environment variable is set
Date: Wed, 20 Feb 2013 14:53:13 +0000 [thread overview]
Message-ID: <1361371996-28166-1-git-send-email-damien.lespiau@intel.com> (raw)
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
lib/drmtest.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 117fb31..641028c 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -574,22 +574,24 @@ bool drmtest_only_list_subtests(void)
return list_subtests;
}
+static bool env_set(const char *env_var)
+{
+ char *val;
+
+ val = getenv(env_var);
+ if (!val)
+ return false;
+
+ return atoi(val) != 0;
+}
+
bool drmtest_run_quick(void)
{
static int run_quick = -1;
- if (run_quick == -1) {
- char *igt_quick;
+ if (run_quick == -1)
+ run_quick = env_set("IGT_QUICK");
- igt_quick = getenv("IGT_QUICK");
- if (!igt_quick) {
- run_quick = 0;
- goto out;
- }
-
- run_quick = atoi(igt_quick);
- }
-out:
return run_quick;
}
--
1.7.7.5
next reply other threads:[~2013-02-20 14:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-20 14:53 Damien Lespiau [this message]
2013-02-20 14:53 ` [PATCH 2/4] lib: Allow to override the device id at run time Damien Lespiau
2013-02-20 14:53 ` [PATCH 3/4] rendercopy: Add a way to dump an .aub file with the rendercopy bos Damien Lespiau
2013-02-20 14:53 ` [PATCH 4/4] build: Guard the inclusions of config.h with HAVE_CONFIG_H Damien Lespiau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1361371996-28166-1-git-send-email-damien.lespiau@intel.com \
--to=damien.lespiau@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox