From a95033fdbcf32ea64ad2b75f38315489ee1c2042 Mon Sep 17 00:00:00 2001 From: Joonas Lahtinen Date: Tue, 31 Mar 2015 15:53:17 +0300 Subject: 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 Cc: Thomas Wood Signed-off-by: Joonas Lahtinen Signed-off-by: Thomas Wood --- lib/igt_core.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/igt_core.h') 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 #include #include +#include #include #include #include @@ -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 */ -- cgit v1.2.3