diff options
Diffstat (limited to 'tests/util/piglit-util.c')
-rw-r--r-- | tests/util/piglit-util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c index f6c2ba02e..f01ff5e3a 100644 --- a/tests/util/piglit-util.c +++ b/tests/util/piglit-util.c @@ -334,3 +334,16 @@ char *piglit_load_text_file(const char *file_name, unsigned *size) return text; #endif } + +const char* +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_report_result(PIGLIT_FAIL); + } + + return s; |