summaryrefslogtreecommitdiff
path: root/cffi/ffiplatform.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2012-06-08 11:17:26 +0200
committerArmin Rigo <arigo@tunes.org>2012-06-08 11:17:26 +0200
commitd8ccbc88acda4ea4dd8ef91f1b4fe660bcba9874 (patch)
treef5305b815e5576be5d27522b93163844b3af4c9a /cffi/ffiplatform.py
parent878df19aa883e33b8ec5f224048f22a6eac72376 (diff)
downloadcffi-d8ccbc88acda4ea4dd8ef91f1b4fe660bcba9874.tar.gz
Linux-only tweaks until the test passes.
Diffstat (limited to 'cffi/ffiplatform.py')
-rw-r--r--cffi/ffiplatform.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/cffi/ffiplatform.py b/cffi/ffiplatform.py
index dbaa0ff..0f7f4a8 100644
--- a/cffi/ffiplatform.py
+++ b/cffi/ffiplatform.py
@@ -1,3 +1,4 @@
+import os
class VerificationError(Exception):
@@ -9,11 +10,15 @@ class VerificationMissing(Exception):
cdef, but no verification has been done
"""
-def _get_test_file():
- tst_file = udir.join('test.c')
- i = 0
- # XXX we want to put typedefs here
- while tst_file.check():
- tst_file = udir.join('test%d.c' % i)
- i += 1
- return tst_file
+test_file_counter = 0
+
+def _get_test_file_base():
+ # for now, living in the __pycache__ subdirectory
+ global test_file_counter
+ try:
+ os.mkdir('__pycache__')
+ except OSError:
+ pass
+ tst_file_base = '__pycache__/test%d' % test_file_counter
+ test_file_counter += 1
+ return tst_file_base