← Back to team overview

instant team mailing list archive

Patch for test 3, 5, and 19

 

Hi,

There are some issues with test3.py, test5.py, and test19.py on Windows:

test3.py: The profiling flag -pg is specified in cppargs but not in
lddargs. It needs to be specified in both on Windows.

test5.py: Same as for test3.py

test19.py: Single quotes do not work when running python -c on the command
line:

C:\>python -c 'import os'
  File "<string>", line 1
    'import
          ^
SyntaxError: EOL while scanning single-quoted string

Use double quotes instead.

The attached patch fixes these issues.

Johannes
# HG changeset patch
# User Johannes Ring <johannr@xxxxxxxxx>
# Date 1241084174 -7200
# Node ID d7047136bc5933ee455eac977d5cc99c1aeb8b1f
# Parent  39f228de8e945ac82a0e4f5bb3c025e2c9986b13
Make all tests run in Windows.

diff -r 39f228de8e94 -r d7047136bc59 tests/test19.py
--- a/tests/test19.py	Mon Apr 27 14:43:13 2009 +0200
+++ b/tests/test19.py	Thu Apr 30 11:36:14 2009 +0200
@@ -56,7 +56,7 @@
 assert t1 > t2
 
 # Try importing module in a separate python process
-cmd = "python -c 'import %s'" % modulename
+cmd = 'python -c "import %s"' % modulename
 print cmd
 stat = os.system(cmd)
 assert stat == 0 # a
@@ -79,7 +79,7 @@
 assert t1 > t3
 
 # Try importing module in a separate python process
-cmd = "python -c 'import instant; assert instant.import_module(\"%s\", \"%s\") is not None'" % (sig, cache_dir)
+cmd = 'python -c "import instant; assert instant.import_module(\'%s\', \'%s\') is not None"' % (sig, cache_dir)
 print cmd
 stat = os.system(cmd)
 assert stat == 0 # b
@@ -102,7 +102,7 @@
 assert t1 > t3
 
 # Try importing module in a separate python process
-cmd = "python -c 'import instant; assert instant.import_module(\"%s\", \"%s\") is not None'" % (sig, cache_dir)
+cmd = 'python -c "import instant; assert instant.import_module(\'%s\', \'%s\') is not None"' % (sig, cache_dir)
 print cmd
 stat = os.system(cmd)
 assert stat == 0 # c
diff -r 39f228de8e94 -r d7047136bc59 tests/test3.py
--- a/tests/test3.py	Mon Apr 27 14:43:13 2009 +0200
+++ b/tests/test3.py	Thu Apr 30 11:36:14 2009 +0200
@@ -9,7 +9,8 @@
 }
 """
 
-build_module(code=c_code, modulename='test3_ext', cppargs=['-pg', '-O3', '-g'])
+build_module(code=c_code, modulename='test3_ext',
+             cppargs=['-pg', '-O3', '-g'], lddargs=['-pg'])
 
 from test3_ext import sum 
 a = 3.7
diff -r 39f228de8e94 -r d7047136bc59 tests/test5.py
--- a/tests/test5.py	Mon Apr 27 14:43:13 2009 +0200
+++ b/tests/test5.py	Thu Apr 30 11:36:14 2009 +0200
@@ -22,7 +22,8 @@
 """
 
 
-test5_ext = build_module(code=c_code, system_headers=["numpy/arrayobject.h"], cppargs=['-pg'],
+test5_ext = build_module(code=c_code, system_headers=["numpy/arrayobject.h"],
+          cppargs=['-pg'], lddargs=['-pg'],
           include_dirs=[numpy.get_include()],
           init_code='import_array();', modulename='test5_ext', 
           arrays = [['n1', 'array1'],['n2', 'array2'],['n3', 'array3']])