def create_libdoc(result_filepath, libname, python_paths, class_paths): import robot from robot import pythonpathsetter from robot.libdoc import libdoc __extend_classpath(class_paths) for path in python_paths + class_paths: pythonpathsetter.add_path(path) libdoc(libname, result_filepath, format='XML') for path in python_paths + class_paths: pythonpathsetter.remove_path(path)
def get_module_path(module_name, python_paths, class_paths): import red_modules import platform from robot import pythonpathsetter __extend_classpath(class_paths) for path in python_paths + class_paths: pythonpathsetter.add_path(path) module_path = red_modules.get_module_path(module_name) for path in python_paths + class_paths: pythonpathsetter.remove_path(path) return module_path
def exit(code): pythonpathsetter.remove_path(project_dir) sys.exit(code)
return str.decode('gbk') if not args.filename: if not args.skip_build and robot.run('robot/package.robot') != 0: print('run package test failed') exit(-1) if robot.run('robot/install_omp_module.robot') != 0: print('run install omp module test failed') exit(-2) if robot.run('robot/install_agent.robot') != 0: print('run install agent test failed') exit(-3) if robot.run('robot/install_module.robot') != 0: print('run install module test failed') exit(-4) if robot.run('robot/upgrade_module.robot') != 0: print('run upgrade module test failed') exit(-5) else: options = {} if args.test_case: options['test'] = convert_code(args.test_case) robot.run(args.filename, **options) pythonpathsetter.remove_path(project_dir)