You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jf...@apache.org on 2015/06/24 03:59:42 UTC

thrift git commit: Thrift-2922: TRIAL is used with Python tests but not tested accordingly Client: py Patch: jfarrell

Repository: thrift
Updated Branches:
  refs/heads/master 417b631c5 -> 6cdbd98b7


Thrift-2922: TRIAL is used with Python tests but not tested accordingly
Client: py
Patch: jfarrell

Updated configure.ac to require trial for py.twisted tests


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/6cdbd98b
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/6cdbd98b
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/6cdbd98b

Branch: refs/heads/master
Commit: 6cdbd98b717b9f2b720ce7dc2899fbada94876f9
Parents: 417b631
Author: jfarrell <jf...@apache.org>
Authored: Tue Jun 23 21:58:50 2015 -0400
Committer: jfarrell <jf...@apache.org>
Committed: Tue Jun 23 21:58:50 2015 -0400

----------------------------------------------------------------------
 configure.ac                  |  5 ++---
 test/py.twisted/Makefile.am   |  2 +-
 test/py.twisted/test_suite.py | 13 ++++++++-----
 3 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/6cdbd98b/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 83189c3..bc257a3 100755
--- a/configure.ac
+++ b/configure.ac
@@ -260,15 +260,14 @@ AM_CONDITIONAL(WITH_LUA, [test "$have_lua" = "yes"])
 
 AX_THRIFT_LIB(python, [Python], yes)
 if test "$with_python" = "yes";  then
+  AC_PATH_PROG([TRIAL], [trial])
   AM_PATH_PYTHON(2.4,, :)
-  if test "x$PYTHON" != "x" && test "x$PYTHON" != "x:" ; then
+  if test -n "$TRIAL" && test "x$PYTHON" != "x" && test "x$PYTHON" != "x:" ; then
     have_python="yes"
   fi
 fi
 AM_CONDITIONAL(WITH_PYTHON, [test "$have_python" = "yes"])
 
-AC_PATH_PROG([TRIAL], [trial])
-
 AX_THRIFT_LIB(perl, [Perl], yes)
 if test "$with_perl" = "yes"; then
   AC_PATH_PROG([PERL], [perl])

http://git-wip-us.apache.org/repos/asf/thrift/blob/6cdbd98b/test/py.twisted/Makefile.am
----------------------------------------------------------------------
diff --git a/test/py.twisted/Makefile.am b/test/py.twisted/Makefile.am
index 17baa59..5020215 100644
--- a/test/py.twisted/Makefile.am
+++ b/test/py.twisted/Makefile.am
@@ -24,7 +24,7 @@ stubs: ../ThriftTest.thrift ../SmallTest.thrift
 	$(THRIFT) --gen py:twisted ../SmallTest.thrift
 
 check: stubs
-	$(TRIAL) test_suite.py
+	$(TRIAL) ./test_suite.py
 
 clean-local:
 	$(RM) -r gen-py.twisted

http://git-wip-us.apache.org/repos/asf/thrift/blob/6cdbd98b/test/py.twisted/test_suite.py
----------------------------------------------------------------------
diff --git a/test/py.twisted/test_suite.py b/test/py.twisted/test_suite.py
old mode 100644
new mode 100755
index 26c1ee2..048abc5
--- a/test/py.twisted/test_suite.py
+++ b/test/py.twisted/test_suite.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements. See the NOTICE file
@@ -17,9 +19,10 @@
 # under the License.
 #
 
-import sys, glob, time
-sys.path.insert(0, './gen-py.twisted')
-sys.path.insert(0, glob.glob('../../lib/py/build/lib.*')[0])
+import sys, os, glob, time
+basepath = os.path.abspath(os.path.dirname(__file__))
+sys.path.insert(0, os.path.join(basepath, 'gen-py.twisted'))
+sys.path.insert(0, glob.glob(os.path.join(basepath, '../../lib/py/build/lib.*'))[0])
 
 from ThriftTest import ThriftTest
 from ThriftTest.ttypes import Xception, Xtruct
@@ -147,8 +150,8 @@ class ThriftTestCase(unittest.TestCase):
     def testDouble(self):
         self.assertEquals((yield self.client.testDouble(-5.235098235)), -5.235098235)
 
-    # TODO: def testBinary(self) ...		
-		
+    # TODO: def testBinary(self) ...
+
     @defer.inlineCallbacks
     def testStruct(self):
         x = Xtruct()