[Piglit] [PATCH 2/6] Add -rlimit command line option to set the rlimit
Ian Romanick
idr at freedesktop.org
Wed Jul 27 17:50:45 PDT 2011
From: Ian Romanick <ian.d.romanick at intel.com>
---
tests/util/piglit-framework.c | 27 +++++++++++++++++++++++++--
1 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/tests/util/piglit-framework.c b/tests/util/piglit-framework.c
index a034440..074fc9d 100644
--- a/tests/util/piglit-framework.c
+++ b/tests/util/piglit-framework.c
@@ -81,9 +81,9 @@ int main(int argc, char *argv[])
/* Find/remove "-auto" from the argument vector.
*/
for (j = 1; j < argc; j++) {
- if (!strcmp(argv[j], "-auto")) {
- int i;
+ int i;
+ if (!strcmp(argv[j], "-auto")) {
piglit_automatic = 1;
for (i = j + 1; i < argc; i++) {
@@ -91,6 +91,29 @@ int main(int argc, char *argv[])
}
argc--;
j--;
+ } else if (!strcmp(argv[j], "-rlimit")) {
+ char *ptr;
+ unsigned long lim;
+
+ j++;
+ if (j >= argc) {
+ fprintf(stderr, "-rlimit requires an argument");
+ piglit_report_result(PIGLIT_FAIL);
+ }
+
+ lim = strtoul(argv[j], &ptr, 0);
+ if (ptr == argv[j]) {
+ fprintf(stderr, "-rlimit requires an argument");
+ piglit_report_result(PIGLIT_FAIL);
+ }
+
+ piglit_set_rlimit(lim);
+
+ for (i = j + 1; i < argc; i++) {
+ argv[i - 1] = argv[i];
+ }
+ argc -= 2;
+ j -= 2;
}
}
glutInitWindowPosition(0, 0);
--
1.7.4.4
More information about the Piglit
mailing list