From: Damien Lespiau Subject: [PATCH 8/8] build: Provide an --enable-simulation configure option Date: Fri, 19 Jul 2013 17:49:48 +0100 Message-ID: <1374252588-8260-9-git-send-email-damien.lespiau@intel.com> References: <1374252588-8260-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1529652992==" Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 44E46E6163 for ; Fri, 19 Jul 2013 09:50:45 -0700 (PDT) In-Reply-To: <1374252588-8260-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1529652992== Content-Type: text/plain; charset=y Content-Transfer-Encoding: quoted-printable Remembering to set an environment variable is too much trouble, we can now specify --enable-simulation at configure time and always run the test suite tuned for simulation. Signed-off-by: Damien Lespiau --- configure.ac | 11 +++++++++++ lib/drmtest.c | 14 ++++++++++++-- tests/.gitignore | 1 + tests/{drm_lib.sh =3D> drm_lib.sh.in} | 3 ++- 4 files changed, 26 insertions(+), 3 deletions(-) rename tests/{drm_lib.sh =3D> drm_lib.sh.in} (88%) diff --git a/configure.ac b/configure.ac index 1626ce8..0bf4764 100644 --- a/configure.ac +++ b/configure.ac @@ -168,6 +168,15 @@ if test "x$BUILD_TESTS" =3D xyes; then fi AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" =3D xyes]) =20 +AC_ARG_ENABLE([simulation], + [AS_HELP_STRING([--enable-simulation], + [Tune i-g-t for simulation environments])], + [], [enable_simulation=3Dno]) +AS_IF([test x"$enable_simulation" =3D "xyes"], + [AC_DEFINE([ENABLE_SIMULATION], [1], + [i-g-t compiled with simulation environments support])]) +AC_SUBST([ENABLE_SIMULATION], [$enable_simulation]) + AC_CONFIG_FILES([ Makefile benchmarks/Makefile @@ -178,6 +187,7 @@ AC_CONFIG_FILES([ tests/Makefile tools/Makefile tools/quick_dump/Makefile + tests/drm_lib.sh debugger/Makefile debugger/system_routine/Makefile assembler/Makefile @@ -195,6 +205,7 @@ echo "" echo " =E2=80=A2 Tests:" echo " Build tests : ${BUILD_TESTS}" echo " Compile prime tests: ${NOUVEAU}" +echo " Simulation support : ${enable_simulation}" echo "" echo " =E2=80=A2 Tools:" echo " Assembler : ${enable_assembler}" diff --git a/lib/drmtest.c b/lib/drmtest.c index 26748b3..17e48b0 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -26,7 +26,10 @@ * */ =20 -#define _GNU_SOURCE +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -700,12 +703,19 @@ static bool env_set(const char *env_var, bool defau= lt_value) return atoi(val) !=3D 0; } =20 +#ifdef ENABLE_SIMULATION +#define INTEL_SIMULATION_DEFAULT true +#else +#define INTEL_SIMULATION_DEFAULT false +#endif + bool drmtest_run_in_simulation(void) { static int simulation =3D -1; =20 if (simulation =3D=3D -1) - simulation =3D env_set("INTEL_SIMULATION", false); + simulation =3D env_set("INTEL_SIMULATION", + INTEL_SIMULATION_DEFAULT); =20 return simulation; } diff --git a/tests/.gitignore b/tests/.gitignore index d256695..6131c78 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,4 +1,5 @@ ddi_compute_wrpll +drm_lib.sh drm_vma_limiter drm_vma_limiter_cached drm_vma_limiter_cpu diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh.in similarity index 88% rename from tests/drm_lib.sh rename to tests/drm_lib.sh.in index 25197d4..9e482ea 100755 --- a/tests/drm_lib.sh +++ b/tests/drm_lib.sh.in @@ -39,9 +39,10 @@ if [ -d /sys/class/drm ] ; then fi # sysfs may not exist as the 'error' is a new interface in 3.11 =20 +enable_simulation=3D@ENABLE_SIMULATION@ function drmtest_skip_on_simulation() { - [ -n "$INTEL_SIMULATION" ] && exit 77 + [ x"$enable_simulation" =3D "xyes" -o -n "$INTEL_SIMULATION" ] && exit = 77 } =20 drmtest_skip_on_simulation --=20 1.8.3.1 --===============1529652992== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1529652992==--