srcanamdw/codescanner/pyinstaller/e2etests/common/maketests.py
author noe\swadi
Thu, 18 Feb 2010 12:29:02 +0530
changeset 1 22878952f6e2
permissions -rw-r--r--
Committing the CodeScanner Core tool This component has been moved from the StaticAnaApps package. BUG : 5889 (http://developer.symbian.org/webbugs/show_bug.cgi?id=5889).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     1
#!/usr/bin/env python
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     2
# Copyright (C) 2005, Giovanni Bajo
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     3
# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     4
#
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     5
# This program is free software; you can redistribute it and/or
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     6
# modify it under the terms of the GNU General Public License
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     7
# as published by the Free Software Foundation; either version 2
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     8
# of the License, or (at your option) any later version.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     9
#
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    10
# This program is distributed in the hope that it will be useful,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    13
# GNU General Public License for more details.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    14
#
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    16
# along with this program; if not, write to the Free Software
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    18
import sys, string, os
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    19
if sys.platform[:3] == 'win':
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    20
    stripopts = ('',)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    21
    consoleopts = ('', '--noconsole')
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    22
else:
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    23
    stripopts = ('', '--strip')
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    24
    consoleopts = ('',)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    25
if string.find(sys.executable, ' ') > -1:
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    26
    exe = '"%s"' % sys.executable
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    27
else:
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    28
    exe = sys.executable
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    29
if sys.platform[:3] == 'win':
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    30
    spec = "%s ../../Makespec.py --tk %%s %%s %%s %%s %%s --out t%%d hanoi.py" % exe
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    31
    bld = "%s ../../Build.py t%%d/hanoi.spec" % exe
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    32
else:
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    33
    spec = "%s ../../Makespec.py --tk %%s %%s %%s %%s %%s --out /u/temp/t%%d hanoi.py" % exe
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    34
    bld = "%s ../../Build.py /u/temp/t%%d/hanoi.spec" % exe
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    35
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    36
i = 0
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    37
for bldconfig in ('--onedir', '--onefile'):
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    38
    for console in consoleopts:
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    39
        for dbg in ('--debug', ''):
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    40
            for stripopt in stripopts:
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    41
                for upxopt in ('', '--upx'):
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    42
                    cmd = spec % (bldconfig, console, dbg, stripopt, upxopt, i)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    43
                    os.system(cmd)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    44
                    os.system(bld % i)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    45
                    if sys.platform[:5] == 'linux':
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    46
                        if bldconfig == '--onedir':
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    47
                            os.system("ln -s /u/temp/t%d/disthanoi/hanoi hanoi%d" % (i,i))
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    48
                        else:
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    49
                            os.system("ln -s /u/temp/t%d/hanoi hanoi%d" % (i,i))
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    50
                    i += 1
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    51