summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.ac5
-rw-r--r--test/py.twisted/Makefile.am2
-rwxr-xr-x[-rw-r--r--]test/py.twisted/test_suite.py13
3 files changed, 11 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 83189c399..bc257a3ab 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])
diff --git a/test/py.twisted/Makefile.am b/test/py.twisted/Makefile.am
index 17baa599f..5020215d7 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
diff --git a/test/py.twisted/test_suite.py b/test/py.twisted/test_suite.py
index 26c1ee2a1..048abc5bc 100644..100755
--- 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()