Ejemplo n.º 1
0
def adjust_option(option):
    if option.target_os.lower() == 'nuttx':
        option.buildlib = True
        if option.nuttx_home == '':
            ex.fail('--nuttx-home needed for nuttx target')
        else:
            option.nuttx_home = fs.abspath(option.nuttx_home)
            if not fs.exists(option.nuttx_home):
                ex.fail('--nuttx-home %s not exists' % option.nuttx_home)
    if option.target_arch == 'x86':
        option.target_arch = 'i686'
    if option.target_arch == 'x64':
        option.target_arch = 'x86_64'
    if option.cmake_param is None:
        option.cmake_param = []
    if option.compile_flag is None:
        option.compile_flag = []
    if option.link_flag is None:
        option.link_flag = []
    if option.external_include_dir is None:
        option.external_include_dir = []
    if option.external_static_lib is None:
        option.external_static_lib = []
    if option.external_shared_lib is None:
        option.external_shared_lib = []
    if option.iotjs_include_module is None:
        option.iotjs_include_module = []
    if option.iotjs_exclude_module is None:
        option.iotjs_exclude_module = []
    if option.jerry_cmake_param is None:
        option.jerry_cmake_param = []
    if option.jerry_compile_flag is None:
        option.jerry_compile_flag = []
    if option.jerry_link_flag is None:
        option.jerry_link_flag = []
Ejemplo n.º 2
0
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
import subprocess
import getpass

from common.system.filesystem import FileSystem as fs
from common.system.executor import Executor as ex

SCRIPT_PATH = fs.dirname(fs.abspath(__file__))

BUILD_SCRIPT_DEBUG = fs.join(
    SCRIPT_PATH,
    'build.py --clean --config=.build.default.config --buildtype=debug')

BUILD_SCRIPT_RELEASE = fs.join(
    SCRIPT_PATH,
    'build.py --clean --config=.build.default.config --buildtype=release')

GIT_REPO_FORMAT = 'https://github.com/%s/iotjs.git'


def get_repo_url(fork_name):
    return GIT_REPO_FORMAT % fork_name
Ejemplo n.º 3
0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
""" common path for scripts """

from common.system.filesystem import FileSystem as fs

# Root directory for the project.
PROJECT_ROOT = fs.abspath(fs.join(fs.dirname(__file__), fs.pardir, fs.pardir))

# Root Build directory.
BUILD_ROOT = fs.join(PROJECT_ROOT, 'build')

# Root Build directory.
TOOLS_ROOT = fs.join(PROJECT_ROOT, 'tools')

# Root directory for dependencies.
DEPS_ROOT = fs.join(PROJECT_ROOT, 'deps')

# Root directory for test.
TEST_ROOT = fs.join(PROJECT_ROOT, 'test')

RUN_PASS_DIR = fs.join(TEST_ROOT, 'run_pass')
Ejemplo n.º 4
0
def run_fail_test(iotjs):
    passes, fails, skips = run_tests('run_fail', path.RUN_FAIL_DIR)
    if len(fails) > 0:
        print()
        print('%s[ run_fail] Test Failed%s' % (TERM_RED, TERM_EMPTY))
        for fail_test in fails:
            print('  * %s' % path.basename(fail_test))
        return False
    return True


if len(sys.argv) < 2:
    print('Usage: %s <path for iotjs>' % fs.basename(sys.argv[0]))
    exit(1)

iotjs = fs.abspath(sys.argv[1])

if not fs.exists(iotjs):
    print('No iotjs executable: %s' % iotjs)
    exit(1)

tests = [
    {
      'type': 'run_pass',
      'handler': run_pass_test
    },
    {
      'type': 'run_fail',
      'handler': run_fail_test
    }
]