comparison pavement.py @ 0:21aa6e3abb49

Origination.
author Atul Varma <varmaa@toolness.com>
date Sun, 28 Jun 2009 12:02:22 -0700
parents
children 29eaa1fceff1
comparison
equal deleted inserted replaced
-1:000000000000 0:21aa6e3abb49
1 import os
2 import subprocess
3 import shutil
4 import sys
5
6 from paver.easy import *
7
8 @task
9 def auto(options):
10 objdir = os.path.join("..", "mozilla-stuff", "basic-firefox")
11 objdir = os.path.abspath(objdir)
12 incdir = os.path.join(objdir, "dist", "include")
13 libdir = os.path.join(objdir, "dist", "lib")
14
15 print "Building extension."
16
17 result = subprocess.call(
18 ["g++",
19 "-framework", "Python",
20 "-I%s" % incdir,
21 "-L%s" % libdir,
22 "-lmozjs",
23 "-o", "pymonkey.so",
24 "-dynamiclib",
25 "pymonkey.c"]
26 )
27
28 if result:
29 sys.exit(result)
30
31 print "Running test suite."
32
33 new_env = {}
34 new_env.update(os.environ)
35 new_env['DYLD_LIBRARY_PATH'] = libdir
36
37 result = subprocess.call(
38 [sys.executable,
39 "test_pymonkey.py"],
40 env = new_env
41 )
42
43 if result:
44 sys.exit(result)