def _make_test(self, context, build_type, prefix): if has_make_target(context.build_space, 'test') or context.dry_run: if MAKE_EXECUTABLE is None: raise VerbExecutionError("Could not find 'make' executable") cmd = prefix + [MAKE_EXECUTABLE, 'test'] if 'ARGS' not in os.environ: args = [ '-V', # verbose output and generate xml of test summary '-D', 'ExperimentalTest', '--no-compress-output' ] elif os.environ['ARGS']: args = [os.environ['ARGS']] else: args = [] args += context.ctest_args if context.retest_until_pass and context.test_iteration: args += ['--rerun-failed'] if args: # the valus is not quoted here # since each item will be quoted by shlex.quote later if necessary cmd.append('ARGS=%s' % ' '.join(args)) return BuildAction(cmd) else: self.warn( "Could not run tests for package '{0}' because it has no " "'test' target".format(context.package_manifest.name))
def _common_cmake_on_test(self, context, build_type): assert context.build_tests # Figure out if there is a setup file to source prefix = self._get_command_prefix('test', context) if not IS_WINDOWS: if has_make_target(context.build_space, 'test') or context.dry_run: cmd = prefix + [MAKE_EXECUTABLE, 'test'] if 'ARGS' not in os.environ: cmd.append('ARGS="-V"') yield BuildAction(cmd) else: self.warn( "Could not run tests for '{0}' package because it has no " "'test' target".format(build_type)) else: if MSBUILD_EXECUTABLE is None: raise VerbExecutionError("Could not find 'msbuild' executable") run_tests_project_file = project_file_exists_at( context.build_space, 'RUN_TESTS') if run_tests_project_file is not None or context.dry_run: yield BuildAction(prefix + [MSBUILD_EXECUTABLE, run_tests_project_file]) else: self.warn( "Could not find Visual Studio project file 'RUN_TESTS.vcxproj'" )
def _common_cmake_on_uninstall(self, context, build_type): # Figure out if there is a setup file to source prefix = self._get_command_prefix('uninstall', context) if not IS_WINDOWS: if has_make_target(context.build_space, 'uninstall'): if MAKE_EXECUTABLE is None: raise VerbExecutionError( "Could not find 'make' executable") cmd = prefix + [MAKE_EXECUTABLE, 'uninstall'] yield BuildAction(cmd) else: self.warn( "Could not run uninstall for '{0}' package because it has no " "'uninstall' target".format(build_type)) else: if MSBUILD_EXECUTABLE is None: raise VerbExecutionError("Could not find 'msbuild' executable") uninstall_project_file = project_file_exists_at( context.build_space, 'UNINSTALL') if uninstall_project_file is not None: yield BuildAction(prefix + [MSBUILD_EXECUTABLE, uninstall_project_file]) else: self.warn( "Could not find Visual Studio project file 'UNINSTALL.vcxproj'" )
def _make_test(self, context, build_type, prefix): if has_make_target(context.build_space, 'test') or context.dry_run: if MAKE_EXECUTABLE is None: raise VerbExecutionError("Could not find 'make' executable") cmd = prefix + [MAKE_EXECUTABLE, 'test'] if 'ARGS' not in os.environ: args = [ '-V', # verbose output and generate xml of test summary '-D', 'ExperimentalTest', '--no-compress-output'] elif os.environ['ARGS']: args = [os.environ['ARGS']] else: args = [] args += context.ctest_args if context.retest_until_pass and context.test_iteration: args += ['--rerun-failed'] if args: # the valus is not quoted here # since each item will be quoted by shlex.quote later if necessary cmd.append('ARGS=%s' % ' '.join(args)) return BuildAction(cmd) else: self.warn("Could not run tests for package '{0}' because it has no " "'test' target".format(context.package_manifest.name))
def _common_cmake_on_install(self, context): # Figure out if there is a setup file to source prefix = self._get_command_prefix('install', context) if not IS_WINDOWS: if has_make_target(context.build_space, 'install') or context.dry_run: if MAKE_EXECUTABLE is None: raise VerbExecutionError( "Could not find 'make' executable") yield BuildAction(prefix + [MAKE_EXECUTABLE, 'install']) else: self.warn( 'Could not run installation for package because it has no ' "'install' target") else: install_project_file = project_file_exists_at( context.build_space, 'INSTALL') if install_project_file is not None: if MSBUILD_EXECUTABLE is None: raise VerbExecutionError( "Could not find 'msbuild' executable") yield BuildAction(prefix + [ MSBUILD_EXECUTABLE, '/p:Configuration=' + self._get_visual_studio_configuration(context), install_project_file ]) else: self.warn( "Could not find Visual Studio project file 'INSTALL.vcxproj'" )
def _common_cmake_on_install(self, context): # Figure out if there is a setup file to source prefix = self._get_command_prefix('install', context) if not IS_WINDOWS: if has_make_target(context.build_space, 'install') or context.dry_run: if MAKE_EXECUTABLE is None: raise VerbExecutionError("Could not find 'make' executable") yield BuildAction(prefix + [MAKE_EXECUTABLE, 'install']) else: self.warn('Could not run installation for package because it has no ' "'install' target") else: install_project_file = project_file_exists_at( context.build_space, 'INSTALL') if install_project_file is not None: if MSBUILD_EXECUTABLE is None: raise VerbExecutionError("Could not find 'msbuild' executable") yield BuildAction( prefix + [ MSBUILD_EXECUTABLE, '/p:Configuration=' + self._get_visual_studio_configuration(context), install_project_file]) else: self.warn("Could not find Visual Studio project file 'INSTALL.vcxproj'")
def _make_uninstall(self, context, build_type, prefix): if has_make_target(context.build_space, 'uninstall'): if MAKE_EXECUTABLE is None: raise VerbExecutionError("Could not find 'make' executable") cmd = prefix + [MAKE_EXECUTABLE, 'uninstall'] return BuildAction(cmd) else: self.warn("Could not run uninstall for package '{0}' because it has no " "'uninstall' target".format(context.package_manifest.name))
def _make_uninstall(self, context, build_type, prefix): if has_make_target(context.build_space, 'uninstall'): if MAKE_EXECUTABLE is None: raise VerbExecutionError("Could not find 'make' executable") cmd = prefix + [MAKE_EXECUTABLE, 'uninstall'] return BuildAction(cmd) else: self.warn("Could not run uninstall for package '{0}' because it has no " "'uninstall' target".format(context.package_manifest.name))
def _common_cmake_on_test(self, context, build_type): assert context.build_tests # Figure out if there is a setup file to source # also pass the exec dependencies into the command prefix file prefix = self._get_command_prefix( 'test', context, additional_dependencies=context.exec_dependency_paths_in_workspace) if not IS_WINDOWS: if has_make_target(context.build_space, 'test') or context.dry_run: if MAKE_EXECUTABLE is None: raise VerbExecutionError( "Could not find 'make' executable") cmd = prefix + [MAKE_EXECUTABLE, 'test'] if 'ARGS' not in os.environ: args = [ '-V', # verbose output and generate xml of test summary '-D', 'ExperimentalTest', '--no-compress-output' ] elif os.environ['ARGS']: args = [os.environ['ARGS']] else: args = [] args += context.ctest_args if context.retest_until_pass and context.test_iteration: args += ['--rerun-failed'] if args: # the valus is not quoted here # since each item will be quoted by shlex.quote later if necessary cmd.append('ARGS=%s' % ' '.join(args)) yield BuildAction(cmd) else: self.warn( "Could not run tests for '{0}' package because it has no " "'test' target".format(build_type)) else: if CTEST_EXECUTABLE is None: raise VerbExecutionError("Could not find 'ctest' executable") # invoke CTest directly in order to pass arguments # it needs a specific configuration and currently there are no conf. specific tests cmd = prefix + [ CTEST_EXECUTABLE, # choose configuration on e.g. Windows '-C', self._get_visual_studio_configuration(context), # generate xml of test summary '-D', 'ExperimentalTest', '--no-compress-output', # show all test output '-V', '--force-new-ctest-process'] + \ context.ctest_args if context.retest_until_pass and context.test_iteration: cmd += ['--rerun-failed'] yield BuildAction(cmd)
def _make_or_ninja_install(self, context, prefix): if context.use_ninja: if NINJA_EXECUTABLE is None: raise VerbExecutionError("Could not find 'ninja' executable") return BuildAction(prefix + [NINJA_EXECUTABLE, 'install']) else: if has_make_target(context.build_space, 'install') or context.dry_run: if MAKE_EXECUTABLE is None: raise VerbExecutionError("Could not find 'make' executable") return BuildAction(prefix + [MAKE_EXECUTABLE, 'install']) else: self.warn("Could not run installation for package '{0}' because it has no " "'install' target".format(context.package_manifest.name))
def _make_or_ninja_install(self, context, prefix): if context.use_ninja: if NINJA_EXECUTABLE is None: raise VerbExecutionError("Could not find 'ninja' executable") return BuildAction(prefix + [NINJA_EXECUTABLE, 'install']) else: if has_make_target(context.build_space, 'install') or context.dry_run: if MAKE_EXECUTABLE is None: raise VerbExecutionError("Could not find 'make' executable") return BuildAction(prefix + [MAKE_EXECUTABLE, 'install']) else: self.warn("Could not run installation for package '{0}' because it has no " "'install' target".format(context.package_manifest.name))
def _common_cmake_on_uninstall(self, context, build_type): # Figure out if there is a setup file to source prefix = self._get_command_prefix('uninstall', context) if not IS_WINDOWS: if has_make_target(context.build_space, 'uninstall'): cmd = prefix + [MAKE_EXECUTABLE, 'uninstall'] yield BuildAction(cmd) else: self.warn("Could not run uninstall for '{0}' package because it has no " "'uninstall' target".format(build_type)) else: if MSBUILD_EXECUTABLE is None: raise VerbExecutionError("Could not find 'msbuild' executable") uninstall_project_file = project_file_exists_at(context.build_space, 'UNINSTALL') if uninstall_project_file is not None: yield BuildAction(prefix + [MSBUILD_EXECUTABLE, uninstall_project_file]) else: self.warn("Could not find Visual Studio project file 'UNINSTALL.vcxproj'")
def _common_cmake_on_test(self, context, build_type): assert context.build_tests # Figure out if there is a setup file to source prefix = self._get_command_prefix('test', context) if not IS_WINDOWS: if has_make_target(context.build_space, 'test') or context.dry_run: if MAKE_EXECUTABLE is None: raise VerbExecutionError("Could not find 'make' executable") cmd = prefix + [MAKE_EXECUTABLE, 'test'] if 'ARGS' not in os.environ: args = [ '-V', # verbose output and generate xml of test summary '-D', 'ExperimentalTest', '--no-compress-output'] elif os.environ['ARGS']: args = [os.environ['ARGS']] else: args = [] args += context.ctest_args if args: # the valus is not quoted here # since each item will be quoted by shlex.quote later if necessary cmd.append('ARGS=%s' % ' '.join(args)) yield BuildAction(cmd) else: self.warn("Could not run tests for '{0}' package because it has no " "'test' target".format(build_type)) else: if CTEST_EXECUTABLE is None: raise VerbExecutionError("Could not find 'ctest' executable") # invoke CTest directly in order to pass arguments # it needs a specific configuration and currently there are no conf. specific tests yield BuildAction(prefix + [ CTEST_EXECUTABLE, # choose configuration on e.g. Windows '-C', self._get_visual_studio_configuration(context), # generate xml of test summary '-D', 'ExperimentalTest', '--no-compress-output', # show all test output '-V', '--force-new-ctest-process'] + context.ctest_args)
def _common_cmake_on_test(self, context, build_type): assert context.build_tests # Figure out if there is a setup file to source prefix = self._get_command_prefix("test", context) if not IS_WINDOWS: if has_make_target(context.build_space, "test") or context.dry_run: cmd = prefix + [MAKE_EXECUTABLE, "test"] if "ARGS" not in os.environ: cmd.append('ARGS="-V"') yield BuildAction(cmd) else: self.warn("Could not run tests for '{0}' package because it has no " "'test' target".format(build_type)) else: if MSBUILD_EXECUTABLE is None: raise VerbExecutionError("Could not find 'msbuild' executable") run_tests_project_file = project_file_exists_at(context.build_space, "RUN_TESTS") if run_tests_project_file is not None or context.dry_run: yield BuildAction(prefix + [MSBUILD_EXECUTABLE, run_tests_project_file]) else: self.warn("Could not find Visual Studio project file 'RUN_TESTS.vcxproj'")