[PATCH] Fix test to correctly use cmake feature to find python executable

Carl Worth cworth at cworth.org
Mon Jan 28 12:22:31 PST 2013


>From 90e11658816b9b9e6498dffee0aa0283d9b9ebba Mon Sep 17 00:00:00 2001
From: Carl Worth <cworth at cworth.org>
Date: Mon, 28 Jan 2013 21:55:12 +1100
Subject: 

On my system, at least, there was no ${python} variable set, so the
tests for PIL were incorrectly failing, (such that many tests were not
being run at all).
---

José Fonseca <jose.r.fonseca at gmail.com> writes:
> Ok, the problems I saw were on system which lack PIL (e.g., it's hard
> to get it on MacOSX), but I had already avoided the issue with commit
> https://github.com/apitrace/apitrace-tests/commit/883a8b3506e6818add1c162ce8de690afcfe79e3
>
> So I merged that branch into master and pushed.

Excellent, thanks!

Note that for me, your patch caused all of these tests to stop running
even though I do have PIL installed, (the cmake test was trying to
execute "-c" instead of "python -c").

I mentioned my fix in my "Some apitrace-tests updates" thread, but I'm
also providing it here now for easier application.

-Carl

 CMakeLists.txt |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a6ea174..1394b4e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required (VERSION 2.8)
-
+INCLUDE (FindPythonInterp)
 
 # Use clang on MacOSX. gcc doesn't support __thread key, and Apple has
 # abandoned it for clang.  This must be done before the project is defined.
@@ -50,7 +50,7 @@ endif ()
 # Check for the presence of several python packages, which are needed to build
 # generated tests.
 execute_process(
-    COMMAND ${python} -c "import PIL"
+    COMMAND ${PYTHON_EXECUTABLE} -c "import PIL"
     OUTPUT_QUIET
     ERROR_QUIET
     RESULT_VARIABLE IMPORT_PIL_RESULT)
-- 
1.7.10.4



More information about the apitrace mailing list