summaryrefslogtreecommitdiff
path: root/lib/igt_core.h
diff options
context:
space:
mode:
authorJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2015-03-31 15:53:17 +0300
committerThomas Wood <thomas.wood@intel.com>2015-04-02 16:32:47 +0100
commita95033fdbcf32ea64ad2b75f38315489ee1c2042 (patch)
tree2448cd63884ec3a078ea38057062140faa173af5 /lib/igt_core.h
parent590e47c94fd81a182e24b41a715d84491df8cea8 (diff)
tests: install test programs to libexec
Install the test programs by default so that they can be packaged. Tested with the testdisplay test so that it still runs after the modifications as it depends on a data file to be present. Need to pass -r option to enable QR code display on success (PNG data file). Packaging is useful when building a complete software stack for a DUT from scratch. This should bring us closer to achieving a built-from-scratch testing workflow. Package maintainers can always decide to ignore the installed files. v2: - Install more tests including scripts and their data v3: - Add clarification to commit message about why we do this. (Chris Wilson & Thomas Wood) - Change libexec into pkglibexec to comply to standard (Thomas Wood) - Do not install $(common_files). (Thomas Wood) - Make it really obvious the installed files are tests by using tests directory name to avoid any confusion with packagers. v4: - Fixed commit message. v5: - Add file locator helper to retain backwards compatibility. (Thomas Wood) - Test with testdisplay -r option that draws the .png file. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'lib/igt_core.h')
-rw-r--r--lib/igt_core.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/igt_core.h b/lib/igt_core.h
index 33f89406..4e56be8a 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -33,6 +33,7 @@
#include <setjmp.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <stdarg.h>
@@ -650,4 +651,16 @@ extern enum igt_log_level igt_log_level;
void igt_set_timeout(unsigned int seconds);
+FILE *__igt_fopen_data(const char* igt_srcdir, const char* igt_datadir,
+ const char* filename);
+/**
+ * igt_fopen_data:
+ * @filename: filename to open.
+ *
+ * Open a datafile for test, first try from installation directory
+ * then from build directory.
+ */
+#define igt_fopen_data(filename) \
+ __igt_fopen_data(IGT_SRCDIR, IGT_DATADIR, filename)
+
#endif /* IGT_CORE_H */