summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2014-03-22 11:20:33 -0700
committerChad Versace <chad.versace@linux.intel.com>2014-04-17 13:12:40 -0700
commit60c2be4c4018384c32006f9a539721d816a3636d (patch)
treea4fcf40e4f9c07ca6a68864e0538c07ce2abe310
parent13ea3cc10f05754b4385148b536acb515b75363c (diff)
util: Use piglit-log in piglit-util.c
This patch replaces each occurence of printf in piglit-util.c, when appropriate, with piglit_loge() or piglit_logi(). Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r--tests/util/piglit-util.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index ecc005436..cefc303b2 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -282,26 +282,24 @@ piglit_set_rlimit(unsigned long lim)
#if defined(USE_SETRLIMIT) && defined(RLIMIT_AS)
struct rlimit rl;
if (getrlimit(RLIMIT_AS, &rl) != -1) {
- printf("Address space limit = %lu, max = %lu\n",
+ piglit_logi("Address space limit = %lu, max = %lu",
(unsigned long) rl.rlim_cur,
(unsigned long) rl.rlim_max);
if (rl.rlim_max > lim) {
- printf("Resetting limit to %lu.\n", lim);
+ piglit_logi("Resetting limit to %lu", lim);
rl.rlim_cur = lim;
rl.rlim_max = lim;
if (setrlimit(RLIMIT_AS, &rl) == -1) {
- printf("Could not set rlimit "
- "due to: %s (%d)\n",
+ piglit_loge("Could not set rlimit "
+ "due to: %s (%d)",
strerror(errno), errno);
}
}
}
-
- printf("\n");
#else
- printf("Cannot reset rlimit on this platform.\n\n");
+ piglit_loge("Cannot reset rlimit on this platform");
#endif
}
@@ -448,7 +446,7 @@ piglit_source_dir(void)
const char *s = getenv("PIGLIT_SOURCE_DIR");
if (s == NULL) {
- printf("error: env var PIGLIT_SOURCE_DIR is undefined\n");
+ piglit_loge("env var PIGLIT_SOURCE_DIR is undefined");
piglit_report_result(PIGLIT_FAIL);
}
@@ -559,14 +557,13 @@ piglit_parse_subtest_args(int *argc, char *argv[],
++j;
if (j >= *argc) {
- fprintf(stderr,
- "-subtest requires an argument\n");
+ piglit_loge("-subtest requires an argument");
piglit_report_result(PIGLIT_FAIL);
}
if (!piglit_find_subtest(subtests, argv[j])) {
- fprintf(stderr, "Test defines no subtest with "
- "name '%s'\n", argv[j]);
+ piglit_loge("Test defines no subtest with "
+ "name '%s'", argv[j]);
piglit_report_result(PIGLIT_FAIL);
}
@@ -587,7 +584,7 @@ piglit_parse_subtest_args(int *argc, char *argv[],
int i;
if (subtests == NULL) {
- fprintf(stderr, "Test defines no subtests!\n");
+ piglit_loge("Test defines no subtests!");
exit(EXIT_FAILURE);
}
@@ -637,9 +634,7 @@ piglit_run_selected_subtests(const struct piglit_subtest *all_subtests,
piglit_find_subtest(all_subtests, name);
if (subtest == NULL) {
- fprintf(stderr,
- "Unknown subtest \"%s\".\n",
- name);
+ piglit_loge("Unknown subtest \"%s\"", name);
piglit_report_result(PIGLIT_FAIL);
}