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')
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
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')
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')
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')
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')
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
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')
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')
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')
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')
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)
def git_fetch_origin(): return ex.run_cmd('git fetch origin')
def git_rebase_on_master(): return ex.run_cmd('git rebase master')
def git_push(): return ex.run_cmd('git push origin master')
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)
def git_remove_merge(merge_branch): return ex.run_cmd('git branch -D %s' % merge_branch)
def git_merge(merge_branch): return ex.run_cmd('git merge %s' % merge_branch)
def git_checkout_master(): return ex.run_cmd('git checkout master')
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))
def git_rebase_origin_master(): return ex.run_cmd('git rebase origin/master')
def check_build(): return (ex.run_cmd(BUILD_SCRIPT_DEBUG) or ex.run_cmd(BUILD_SCRIPT_RELEASE))
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))