File: test-full_prerelease.py

package info (click to toggle)
python-bsddb3 5.2.0-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,012 kB
  • sloc: python: 15,027; ansic: 8,521; makefile: 114; sh: 5
file content (46 lines) | stat: -rwxr-xr-x 1,546 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python

"""
This program checks all the matrix formed by
several Python and Berkeley DB versions.

This code is only intented to be used by the
maintainer, just before a pybsddb release, to
verify compatibility and regresions. It contains
local details only applicable to maintainer. If
you try it as is, it would fail.
"""

def do_matrix_check() :
  python_versions=("2.3","2.4","2.5","2.6","2.7","3.1","3.2")
  berkeleydb_versions=("4.2","4.3","4.4","4.5","4.6","4.7","4.8","5.0","5.1","5.2")

  warning_level=("-Wdefault", "-Werror")[1]
  import subprocess

  for py in python_versions :
    for bdb in berkeleydb_versions :
      print
      print "*** Testing bindings for Python %s and Berkeley DB %s" %(py,bdb)
      extra_params = [warning_level, "-tt"]
      # Extra flags for 3.x
      extra_params += [] if float(py)<=2.999 else ["-bb"]
      # Extra flags for >=2.6
      extra_params += [] if ((float(py)<=2.599) or (float(py)>=2.999)) else ["-3"]
      params = extra_params + ["setup.py", "-q", \
                 "--berkeley-db=/usr/local/BerkeleyDB."+bdb,"build", "-f"]
      params = ["/usr/local/bin/python"+py] + params
      print "EXECUTING:", " ".join(params)
      ret=subprocess.call(params)
      if ret :
        print
        print ">>> Testsuite skipped"
        print
      else :
        params = ["/usr/local/bin/python"+py] + extra_params + ["test.py","-p"]
        print "EXECUTING:", " ".join(params)
        subprocess.call(params)

if __name__=="__main__" :
  print __doc__
  do_matrix_check()