示例#1
0
def run_checktest(options):
    checktest_quiet = 'yes'
    if os.getenv('TRAVIS') == "true":
        checktest_quiet = 'no'

    # iot.js executable
    iotjs = fs.join(options.build_root, 'iotjs', 'iotjs')
    build_args = ['--', 'quiet=' + checktest_quiet]
    if options.iotjs_exclude_module:
        skip_module = ','.join(options.iotjs_exclude_module)
        build_args.append('skip-module=' + skip_module)

    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(iotjs, [path.CHECKTEST_PATH] + build_args)
    if code != 0:
        ex.fail('Failed to pass unit tests')
    if not options.no_check_valgrind:
        code = ex.run_cmd('valgrind', ['--leak-check=full',
                                       '--error-exitcode=5',
                                       '--undef-value-errors=no',
                                       iotjs,
                                       path.CHECKTEST_PATH] + build_args)
        if code == 5:
            ex.fail('Failed to pass valgrind test')
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
示例#2
0
def run_checktest(option):
    checktest_quiet = 'yes'
    if os.getenv('TRAVIS') == "true":
        checktest_quiet = 'no'

    # iot.js executable
    iotjs = fs.join(build_root, 'iotjs', 'iotjs')
    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(iotjs, [path.CHECKTEST_PATH,
                              '--',
                              'quiet='+checktest_quiet])
    if code != 0:
        ex.fail('Failed to pass unit tests')
    if not option.no_check_valgrind:
        code = ex.run_cmd('valgrind', ['--leak-check=full',
                                       '--error-exitcode=5',
                                       '--undef-value-errors=no',
                                       iotjs,
                                       path.CHECKTEST_PATH,
                                       '--',
                                       'quiet='+checktest_quiet])
        if code == 5:
            ex.fail('Failed to pass valgrind test')
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
    return True
示例#3
0
文件: build.py 项目: weizhuhua/iotjs
def run_checktest(options):
    checktest_quiet = 'yes'
    if os.getenv('TRAVIS') == "true":
        checktest_quiet = 'no'

    # IoT.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')
    build_args = ['quiet=' + checktest_quiet]

    # experimental
    if options.experimental:
        build_args.append('experimental=' + 'yes');

    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(iotjs, [path.CHECKTEST_PATH] + build_args)
    if code != 0:
        ex.fail('Failed to pass unit tests')
    if not options.no_check_valgrind:
        code = ex.run_cmd('valgrind', ['--leak-check=full',
                                       '--error-exitcode=5',
                                       '--undef-value-errors=no',
                                       iotjs,
                                       path.CHECKTEST_PATH] + build_args)
        if code == 5:
            ex.fail('Failed to pass valgrind test')
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
示例#4
0
def run_checktest(options):
    checktest_quiet = 'yes'
    if os.getenv('TRAVIS') == "true":
        checktest_quiet = 'no'

    # IoT.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')
    cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
    args = [iotjs]

    # testsets
    if options.testsets:
        args.append('--testsets=' + options.testsets);

    if options.run_test == "quiet":
        args.append('--quiet')

    fs.chdir(path.PROJECT_ROOT)

    # run unit tests
    code = ex.run_cmd(cmd, args)
    if code != 0:
        ex.fail('Failed to pass unit tests')

    if not options.no_check_valgrind:
        code = ex.run_cmd(cmd, ['--valgrind'] + args)
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
示例#5
0
def run_checktest(options):
    checktest_quiet = 'yes'
    if os.getenv('TRAVIS') == "true":
        checktest_quiet = 'no'

    # iot.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')
    build_args = ['--', 'quiet=' + checktest_quiet]
    if options.iotjs_exclude_module:
        skip_module = ','.join(options.iotjs_exclude_module)
        build_args.append('skip-module=' + skip_module)

    # experimental
    if options.experimental:
        build_args.append('experimental=' + 'yes');

    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(iotjs, [path.CHECKTEST_PATH] + build_args)
    if code != 0:
        ex.fail('Failed to pass unit tests')
    if not options.no_check_valgrind:
        code = ex.run_cmd('valgrind', ['--leak-check=full',
                                       '--error-exitcode=5',
                                       '--undef-value-errors=no',
                                       iotjs,
                                       path.CHECKTEST_PATH] + build_args)
        if code == 5:
            ex.fail('Failed to pass valgrind test')
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
示例#6
0
文件: build.py 项目: rerobika/iotjs
def run_checktest(options):
    # IoT.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')

    cmd = []
    args = []
    if options.test_driver == "js":
        cmd = iotjs
        args = [path.CHECKTEST_PATH]

        # quiet
        if options.run_test == "quiet":
            args.append('quiet=yes')

        # testsets
        if options.testsets:
            args.append('testsets=' + options.testsets)

        # experimental
        if options.experimental:
            args.append('experimental=yes')
    else:
        cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
        args = [iotjs]

        # testsets
        if options.testsets:
            args.append('--testsets=' + options.testsets)

        if options.run_test == "quiet":
            args.append('--quiet')

    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(cmd, args)
    if code != 0:
        ex.fail('Failed to pass unit tests')

    if not options.no_check_valgrind:
        if options.test_driver == "js":
            code = ex.run_cmd('valgrind', [
                '--leak-check=full', '--error-exitcode=5',
                '--undef-value-errors=no', cmd
            ] + args)
            if code == 5:
                ex.fail('Failed to pass valgrind test')
            if code != 0:
                ex.fail('Failed to pass unit tests in valgrind environment')
        else:
            code = ex.run_cmd(cmd, ['--valgrind'] + args)
            if code != 0:
                ex.fail('Failed to pass unit tests in valgrind environment')
示例#7
0
文件: precommit.py 项目: esevan/iotjs
def build_nuttx(nuttx_root, buildtype):
    fs.chdir(fs.join(nuttx_root, 'nuttx'))
    try:
        code = 0
        if buildtype == "release":
            code = ex.run_cmd('make',
                              ['IOTJS_ROOT_DIR=' + path.PROJECT_ROOT, 'R=1'])
        else:
            code = ex.run_cmd('make',
                              ['IOTJS_ROOT_DIR=' + path.PROJECT_ROOT, 'R=0'])

        if code == 0:
            return True
        else:
            print 'Failed to build nuttx'
            return False
    except OSError as err:
        print 'Failed to build nuttx: %s' % err
        return False
示例#8
0
文件: build.py 项目: shanghaife/iotjs
def run_checktest(options):
    # IoT.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')

    cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
    args = [iotjs, "--platform=%s" % options.target_os]

    if options.run_test == "quiet":
        args.append('--quiet')

    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(cmd, args)
    if code != 0:
        ex.fail('Failed to pass unit tests')

    if not options.no_check_valgrind:
        code = ex.run_cmd(cmd, ['--valgrind'] + args)
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
示例#9
0
def build_nuttx(nuttx_root, buildtype):
    fs.chdir(fs.join(nuttx_root, 'nuttx'))
    try:
        code = 0
        if buildtype == "release":
            code = ex.run_cmd('make',
                              ['IOTJS_ROOT_DIR=' + path.PROJECT_ROOT, 'R=1'])
        else:
            code = ex.run_cmd('make',
                              ['IOTJS_ROOT_DIR=' + path.PROJECT_ROOT, 'R=0'])

        if code == 0:
            return True
        else:
            print 'Failed to build nuttx'
            return False
    except OSError as err:
        print 'Failed to build nuttx: %s' % err
        return False
示例#10
0
文件: build.py 项目: MoonkiHong/iotjs
def run_checktest(options):
    # IoT.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')

    cmd = []
    args = []
    if options.test_driver == "js":
        cmd = iotjs
        args = [path.CHECKTEST_PATH]
        if options.run_test == "quiet":
            args.append('quiet=yes')

        # experimental
        if options.experimental:
            args.append('experimental=yes');
    else:
        cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
        args = [iotjs]
        if options.run_test == "quiet":
            args.append('--quiet')


    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(cmd, args)
    if code != 0:
        ex.fail('Failed to pass unit tests')

    if not options.no_check_valgrind:
        if options.test_driver == "js":
            code = ex.run_cmd('valgrind', ['--leak-check=full',
                                           '--error-exitcode=5',
                                           '--undef-value-errors=no',
                                           cmd] + args)
            if code == 5:
                ex.fail('Failed to pass valgrind test')
            if code != 0:
                ex.fail('Failed to pass unit tests in valgrind environment')
        else:
            code = ex.run_cmd(cmd, ['--valgrind'] + args)
            if code != 0:
                ex.fail('Failed to pass unit tests in valgrind environment')
示例#11
0
def run_checktest(options):
    checktest_quiet = 'yes'
    if os.getenv('TRAVIS') == "true":
        checktest_quiet = 'no'

    # IoT.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')

    cmd = []
    args = []
    if options.test_driver == "js":
        cmd = iotjs
        args = [path.CHECKTEST_PATH, 'quiet=' + checktest_quiet]
        # experimental
        if options.experimental:
            cmd.append('experimental=' + 'yes')
    else:
        cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
        args = [iotjs]
        if checktest_quiet:
            args.append('--quiet')

    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(cmd, args)
    if code != 0:
        ex.fail('Failed to pass unit tests')

    if not options.no_check_valgrind:
        if options.test_driver == "js":
            code = ex.run_cmd('valgrind', [
                '--leak-check=full', '--error-exitcode=5',
                '--undef-value-errors=no', cmd
            ] + args)
            if code == 5:
                ex.fail('Failed to pass valgrind test')
            if code != 0:
                ex.fail('Failed to pass unit tests in valgrind environment')
        else:
            code = ex.run_cmd(cmd, ['--valgrind'] + args)
            if code != 0:
                ex.fail('Failed to pass unit tests in valgrind environment')
示例#12
0
文件: build.py 项目: Samsung/iotjs
def run_checktest(options):
    # IoT.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')

    cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
    args = [iotjs, "--platform=%s" % options.target_os]

    if options.run_test == "quiet":
        args.append('--quiet')

    if options.n_api:
        args.append('--n-api')

    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(cmd, args)
    if code != 0:
        ex.fail('Failed to pass unit tests')

    if not options.no_check_valgrind:
        code = ex.run_cmd(cmd, ['--valgrind'] + args)
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
示例#13
0
def git_fetch_remote(fork_name, branch_name):
    remote_name = get_merge_remote_name(fork_name, branch_name)
    return ex.run_cmd('git fetch %s' % remote_name)
示例#14
0
def git_fetch_origin():
    return ex.run_cmd('git fetch origin')
示例#15
0
def git_rebase_on_master():
    return ex.run_cmd('git rebase master')
示例#16
0
文件: merge.py 项目: esevan/iotjs
def git_push():
    return ex.run_cmd('git push origin master')
示例#17
0
文件: merge.py 项目: esevan/iotjs
def git_remove_remote(fork_name, branch_name):
    remote_name = get_merge_remote_name(fork_name, branch_name)
    return ex.run_cmd('git remote remove %s' % remote_name)
示例#18
0
def git_remove_merge(merge_branch):
    return ex.run_cmd('git branch -D %s' % merge_branch)
示例#19
0
def git_merge(merge_branch):
    return ex.run_cmd('git merge %s' % merge_branch)
示例#20
0
def git_checkout_master():
    return ex.run_cmd('git checkout master')
示例#21
0
def git_add_remote(fork_name, branch_name):
    remote_name = get_merge_remote_name(fork_name, branch_name)
    remote_url = get_repo_url(fork_name)
    return ex.run_cmd('git remote add %s %s' % (remote_name, remote_url))
示例#22
0
文件: merge.py 项目: esevan/iotjs
def git_rebase_origin_master():
    return ex.run_cmd('git rebase origin/master')
示例#23
0
def git_rebase_origin_master():
    return ex.run_cmd('git rebase origin/master')
示例#24
0
文件: merge.py 项目: esevan/iotjs
def git_fetch_remote(fork_name, branch_name):
    remote_name = get_merge_remote_name(fork_name, branch_name)
    return ex.run_cmd('git fetch %s' % remote_name)
示例#25
0
文件: merge.py 项目: esevan/iotjs
def check_build():
    return (ex.run_cmd(BUILD_SCRIPT_DEBUG) or
            ex.run_cmd(BUILD_SCRIPT_RELEASE))
示例#26
0
文件: merge.py 项目: esevan/iotjs
def git_rebase_on_master():
    return ex.run_cmd('git rebase master')
示例#27
0
文件: merge.py 项目: esevan/iotjs
def git_fetch_origin():
    return ex.run_cmd('git fetch origin')
示例#28
0
def git_checkout_for_merge(fork_name, branch_name):
    merge_branch = get_merge_branch_name(fork_name, branch_name)
    remote_name = get_merge_remote_name(fork_name, branch_name)
    return ex.run_cmd('git checkout -b %s %s/%s' %
                      (merge_branch, remote_name, branch_name))
示例#29
0
文件: merge.py 项目: esevan/iotjs
def git_add_remote(fork_name, branch_name):
    remote_name = get_merge_remote_name(fork_name, branch_name)
    remote_url = get_repo_url(fork_name)
    return ex.run_cmd('git remote add %s %s' % (remote_name, remote_url))
示例#30
0
文件: merge.py 项目: esevan/iotjs
def git_merge(merge_branch):
    return ex.run_cmd('git merge %s' % merge_branch)
示例#31
0
文件: merge.py 项目: esevan/iotjs
def git_checkout_for_merge(fork_name, branch_name):
    merge_branch = get_merge_branch_name(fork_name, branch_name)
    remote_name = get_merge_remote_name(fork_name, branch_name)
    return ex.run_cmd('git checkout -b %s %s/%s'
                      % (merge_branch, remote_name, branch_name))
示例#32
0
def check_build():
    return (ex.run_cmd(BUILD_SCRIPT_DEBUG) or ex.run_cmd(BUILD_SCRIPT_RELEASE))
示例#33
0
文件: merge.py 项目: esevan/iotjs
def git_checkout_master():
    return ex.run_cmd('git checkout master')
示例#34
0
def git_push():
    return ex.run_cmd('git push origin master')
示例#35
0
文件: merge.py 项目: esevan/iotjs
def git_remove_merge(merge_branch):
    return ex.run_cmd('git branch -D %s' % merge_branch)
示例#36
0
def git_remove_remote(fork_name, branch_name):
    remote_name = get_merge_remote_name(fork_name, branch_name)
    return ex.run_cmd('git remote remove %s' % remote_name)