(engine)
| 51 | |
| 52 | |
| 53 | def check_engine(engine): |
| 54 | if type(engine) is list: |
| 55 | engine_path = engine[0] |
| 56 | else: |
| 57 | engine_path = engine |
| 58 | global WORKING_ENGINES |
| 59 | if engine_path not in WORKING_ENGINES: |
| 60 | logging.debug('Checking JS engine %s' % engine) |
| 61 | try: |
| 62 | output = run_js(utils.path_from_root('test/hello_world.js'), engine, skip_check=True) |
| 63 | if 'Hello, world!' in output: |
| 64 | WORKING_ENGINES[engine_path] = True |
| 65 | else: |
| 66 | WORKING_ENGINES[engine_path] = False |
| 67 | except Exception as e: |
| 68 | logging.info('Checking JS engine %s failed. Check your config file. Details: %s' % (str(engine), str(e))) |
| 69 | WORKING_ENGINES[engine_path] = False |
| 70 | return WORKING_ENGINES[engine_path] |
| 71 | |
| 72 | |
| 73 | def require_engine(engine): |
no test coverage detected