Exemplo n.º 1
0
def get_version(space):
    ver = "%d.%d.%d" % (PYPY_VERSION[0], PYPY_VERSION[1], PYPY_VERSION[2])
    if PYPY_VERSION[3] != "final":
        ver = ver + "-%s%d" % (PYPY_VERSION[3], PYPY_VERSION[4])
    return space.wrap(
        "%d.%d.%d (%s, %s, %s)\n[PyPy %s%s]" %
        (CPYTHON_VERSION[0], CPYTHON_VERSION[1], CPYTHON_VERSION[2],
         get_repo_version_info()[2], date, time, ver, compiler_version()))
Exemplo n.º 2
0
def get_repo_info(space):
    info = get_repo_version_info()
    if info:
        project, repo_tag, repo_version = info
        return space.newtuple([space.wrap(project),
                               space.wrap(repo_tag),
                               space.wrap(repo_version)])
    else:
        return space.w_None
Exemplo n.º 3
0
def get_repo_info(space):
    info = get_repo_version_info()
    if info:
        project, repo_tag, repo_version = info
        return space.newtuple([space.wrap(project),
                               space.wrap(repo_tag),
                               space.wrap(repo_version)])
    else:
        return space.w_None
Exemplo n.º 4
0
def get_version(space):
    ver = "%d.%d.%d" % (PYPY_VERSION[0], PYPY_VERSION[1], PYPY_VERSION[2])
    if PYPY_VERSION[3] != "final":
        ver = ver + "-%s%d" %(PYPY_VERSION[3], PYPY_VERSION[4])
    return space.wrap("%d.%d.%d (%s, %s, %s)\n[PyPy %s%s]" % (
        CPYTHON_VERSION[0],
        CPYTHON_VERSION[1],
        CPYTHON_VERSION[2],
        get_repo_version_info()[2],
        date,
        time,
        ver,
        compiler_version()))
Exemplo n.º 5
0
Arquivo: udir.py Projeto: ieure/pypy
def make_udir(dir=None, basename=None):
    if dir is not None:
        dir = local(dir)
    if basename is None:
        info = get_repo_version_info()
        if info:
            project, hgtag, hgid = info
            basename = hgtag
            if basename == '?':
                basename = 'unknown' # directories with ? are not fun
                # especially on windows
            if isinstance(basename, unicode):
                basename = basename.encode(sys.getdefaultencoding())
        else:
            basename = ''
    if not basename.startswith('-'):
        basename = '-' + basename
    if not basename.endswith('-'):
        basename = basename + '-'
    return local.make_numbered_dir(rootdir = dir,
                                   prefix = 'usession' + basename,
                                   keep = PYPY_KEEP)
Exemplo n.º 6
0
def make_udir(dir=None, basename=None):
    if dir is not None:
        dir = local(dir)
    if basename is None:
        info = get_repo_version_info()
        if info:
            project, hgtag, hgid = info
            basename = hgtag
            if basename == '?':
                basename = 'unknown'  # directories with ? are not fun
                # especially on windows
            if isinstance(basename, unicode):
                basename = basename.encode(sys.getdefaultencoding())
        else:
            basename = ''
    if not basename.startswith('-'):
        basename = '-' + basename
    if not basename.endswith('-'):
        basename = basename + '-'
    return local.make_numbered_dir(rootdir=dir,
                                   prefix='usession' + basename,
                                   keep=PYPY_KEEP)
Exemplo n.º 7
0
def test_get_repo_version_info():
    assert get_repo_version_info(None)
    assert get_repo_version_info(os.devnull) == ('PyPy', '?', '?')
    assert get_repo_version_info(sys.executable) == ('PyPy', '?', '?')
Exemplo n.º 8
0
def test_get_repo_version_info():
    assert get_repo_version_info(None)
    assert get_repo_version_info(os.devnull) == ('PyPy', '?', '?')
    assert get_repo_version_info(sys.executable) == ('PyPy', '?', '?')
import os, sys
from pypy.translator.test import rpystone
from pypy.translator.goal import richards
import pypy.interpreter.gateway  # needed before sys, order of imports !!!
from pypy.tool.version import get_repo_version_info

# __________  Entry point  __________

VERSION = get_repo_version_info()[2]

# note that we have %f but no length specifiers in RPython


def pystones_main(loops):
    benchtime, stones = rpystone.pystones(abs(loops))
    s = ""  # annotator happiness
    if loops >= 0:
        s = (
            "RPystone(%s) time for %d passes = %f" % (VERSION, loops, benchtime)
            + "\n"
            + ("This machine benchmarks at %f pystones/second\n" % stones)
        )
    os.write(1, s)
    if loops == 12345:
        pystones_main(loops - 1)


def richards_main(iterations):
    s = "Richards benchmark (RPython) starting...\n"
    os.write(1, s)
    result, startTime, endTime = richards.entry_point(iterations)
Exemplo n.º 10
0
import os, sys
from pypy.translator.test import rpystone
from pypy.translator.goal import richards
import pypy.interpreter.gateway  # needed before sys, order of imports !!!
from pypy.tool.version import get_repo_version_info

# __________  Entry point  __________

VERSION = get_repo_version_info()[2]

# note that we have %f but no length specifiers in RPython


def pystones_main(loops):
    benchtime, stones = rpystone.pystones(abs(loops))
    s = ''  # annotator happiness
    if loops >= 0:
        s = ("RPystone(%s) time for %d passes = %f" %
             (VERSION, loops, benchtime) + '\n' +
             ("This machine benchmarks at %f pystones/second\n" % stones))
    os.write(1, s)
    if loops == 12345:
        pystones_main(loops - 1)


def richards_main(iterations):
    s = "Richards benchmark (RPython) starting...\n"
    os.write(1, s)
    result, startTime, endTime = richards.entry_point(iterations)
    if not result:
        os.write(2, "Incorrect results!\n")