Beispiel #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')
Beispiel #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
Beispiel #3
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]

    # 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')
Beispiel #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')
Beispiel #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')
Beispiel #6
0
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')
Beispiel #7
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
Beispiel #8
0
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')
Beispiel #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
Beispiel #10
0
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')
Beispiel #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')
Beispiel #12
0
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')
Beispiel #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)
Beispiel #14
0
def git_fetch_origin():
    return ex.run_cmd('git fetch origin')
Beispiel #15
0
def git_rebase_on_master():
    return ex.run_cmd('git rebase master')
Beispiel #16
0
def git_push():
    return ex.run_cmd('git push origin master')
Beispiel #17
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)
Beispiel #18
0
def git_remove_merge(merge_branch):
    return ex.run_cmd('git branch -D %s' % merge_branch)
Beispiel #19
0
def git_merge(merge_branch):
    return ex.run_cmd('git merge %s' % merge_branch)
Beispiel #20
0
def git_checkout_master():
    return ex.run_cmd('git checkout master')
Beispiel #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))
Beispiel #22
0
def git_rebase_origin_master():
    return ex.run_cmd('git rebase origin/master')
Beispiel #23
0
def git_rebase_origin_master():
    return ex.run_cmd('git rebase origin/master')
Beispiel #24
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)
Beispiel #25
0
def check_build():
    return (ex.run_cmd(BUILD_SCRIPT_DEBUG) or
            ex.run_cmd(BUILD_SCRIPT_RELEASE))
Beispiel #26
0
def git_rebase_on_master():
    return ex.run_cmd('git rebase master')
Beispiel #27
0
def git_fetch_origin():
    return ex.run_cmd('git fetch origin')
Beispiel #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))
Beispiel #29
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))
Beispiel #30
0
def git_merge(merge_branch):
    return ex.run_cmd('git merge %s' % merge_branch)
Beispiel #31
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))
Beispiel #32
0
def check_build():
    return (ex.run_cmd(BUILD_SCRIPT_DEBUG) or ex.run_cmd(BUILD_SCRIPT_RELEASE))
Beispiel #33
0
def git_checkout_master():
    return ex.run_cmd('git checkout master')
Beispiel #34
0
def git_push():
    return ex.run_cmd('git push origin master')
Beispiel #35
0
def git_remove_merge(merge_branch):
    return ex.run_cmd('git branch -D %s' % merge_branch)
Beispiel #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)