def skip_test(self, test): skip_list = test.get("skip", []) # Skip by the `skip` attribute in testsets.json file. for i in ["all", Platform().os(), self.stability]: if i in skip_list: return True name_parts = test["name"][0:-3].split('_') # Test filename does not start with 'test_' so we'll just # assume we support it. if name_parts[0] != 'test': return False tested_module = name_parts[1] # Skip the test if it requires a module that is defined by # the `--skip-modules` flag. if tested_module in self.skip_modules: test["reason"] = "the required module is skipped by testrunner" return True # Skip the test if it requires a module that is not # compiled into the binary. if tested_module not in self.builtins: test["reason"] = "unsupported module by iotjs build" return True return False
def get_args(): parser = argparse.ArgumentParser() parser.add_argument("iotjs", action="store", help="path to the iotjs binary file") parser.add_argument('--platform', default=Platform().os(), help='Specify the platform (default: %(default)s)') parser.add_argument("--quiet", action="store_true", default=False, help="show or hide the output of the tests") parser.add_argument("--skip-modules", action="store", metavar='list', help="module list to skip test of specific modules") parser.add_argument("--timeout", action="store", default=300, type=int, help="default timeout for the tests in seconds") parser.add_argument("--valgrind", action="store_true", default=False, help="check tests with Valgrind") parser.add_argument("--coverage", action="store_true", default=False, help="measure JavaScript coverage") return parser.parse_args()
def skip_test(self, test): skip_list = set(test.get("skip", [])) # Skip by the `skip` attribute in testsets.json file. for i in ["all", Platform().os(), self.stability]: if i in skip_list: return True required_modules = set(test.get("required-modules", [])) required_features = set(test.get("required-features", [])) unsupported_modules = required_modules - self.builtins unsupported_features = required_features - self.features skipped_modules = required_modules.intersection(skip_list) # Skip the test if the tested module requires a module # which is not compiled into the binary if unsupported_modules: test["reason"] = "Required module(s) unsupported by iotjs build: " test["reason"] += ', '.join(sorted(unsupported_modules)) return True # Skip the test if it requires a module that is skipped by the # testrunner if skipped_modules: test["reason"] = "Required module(s) skipped by testrunner: " test["reason"] += ', '.join(sorted(skipped_modules)) return True # Skip the test if it uses features which are # unavailable in the current iotjs build if unsupported_features: test["reason"] = "Required feature(s) unsupported by iotjs build: " test["reason"] += ', '.join(sorted(unsupported_features)) return True return False
# in Python 3.x there is no basestring just str basestring = str import argparse import json import sys import re import os import glob from common_py import path from common_py.system.filesystem import FileSystem as fs from common_py.system.executor import Executor as ex from common_py.system.platform import Platform platform = Platform() # Initialize build options. def init_options(): # Check config options. arg_config = list(filter(lambda x: x.startswith('--config='), sys.argv)) config_path = path.BUILD_CONFIG_PATH if arg_config: config_path = arg_config[-1].split('=', 1)[1] build_config = {} with open(config_path, 'rb') as f: build_config = json.loads(f.read().decode('ascii')) # Read config file and apply it to argv.
# limitations under the License. import argparse import json import sys import re import os from js2c import js2c from common_py import path from common_py.system.filesystem import FileSystem as fs from common_py.system.executor import Executor as ex from common_py.system.platform import Platform platform = Platform() # Initialize build option. def init_option(): # Check config option. arg_config = filter(lambda x: x.startswith('--config='), sys.argv) config_path = path.BUILD_CONFIG_PATH if len(arg_config) != 0: config_path = arg_config[-1].split('=', 1)[1] # Read config file and apply it to argv. argv = [] config = {}
# 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 os from common_py.system.filesystem import FileSystem as fs from common_py.system.executor import Executor as ex from common_py.system.platform import Platform from check_tidy import check_tidy platform = Platform() DOCKER_ROOT_PATH = fs.join('/root') # IoT.js path in travis TRAVIS_BUILD_PATH = fs.join(os.environ['TRAVIS_BUILD_DIR']) # IoT.js path in docker DOCKER_IOTJS_PATH = fs.join(DOCKER_ROOT_PATH, 'work_space/iotjs') DOCKER_TIZENRT_PATH = fs.join(DOCKER_ROOT_PATH, 'TizenRT') DOCKER_TIZENRT_OS_PATH = fs.join(DOCKER_TIZENRT_PATH, 'os') DOCKER_TIZENRT_OS_TOOLS_PATH = fs.join(DOCKER_TIZENRT_OS_PATH, 'tools') DOCKER_NUTTX_PATH = fs.join(DOCKER_ROOT_PATH, 'nuttx')
# 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 os from common_py.system.filesystem import FileSystem as fs from common_py.system.executor import Executor as ex from common_py.system.platform import Platform from check_tidy import check_tidy platform = Platform() DOCKER_ROOT_PATH = fs.join('/root') # IoT.js path in travis TRAVIS_BUILD_PATH = fs.join(os.environ['TRAVIS_BUILD_DIR']) # IoT.js path in docker DOCKER_IOTJS_PATH = fs.join(DOCKER_ROOT_PATH, 'work_space/iotjs') DOCKER_TIZENRT_PATH = fs.join(DOCKER_ROOT_PATH, 'TizenRT') DOCKER_TIZENRT_OS_PATH = fs.join(DOCKER_TIZENRT_PATH, 'os') DOCKER_TIZENRT_OS_TOOLS_PATH = fs.join(DOCKER_TIZENRT_OS_PATH, 'tools') DOCKER_NUTTX_PATH =fs.join(DOCKER_ROOT_PATH, 'nuttx')
# See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function import argparse import sys import os import json from common_py import path from common_py.system.filesystem import FileSystem as fs from common_py.system.executor import Executor as ex from common_py.system.platform import Platform from check_tidy import check_tidy platform = Platform() TESTS=['artik10', 'artik053', 'coverity', 'external-modules', 'host-linux', 'host-darwin', 'nuttx', 'misc', 'no-snapshot', 'rpi2'] BUILDTYPES=['debug', 'release'] NUTTXTAG = 'nuttx-7.19' # This is latest tested TizenRT commit working for IoT.js # Title: Merge pull request #496 from sunghan-chang/iotivity TIZENRT_COMMIT='0f47277170972bb33b51996a374c483e4ff2c26a' def parse_option(): parser = argparse.ArgumentParser( description='IoT.js pre-commit script.', epilog='If no arguments are given, runs full test.')