def test_build_jobs_command_line_overrides(): assert determine_number_of_jobs(parallel=True, command_line=10, config_default=1, max_cpus=1) == 10 assert determine_number_of_jobs(parallel=True, command_line=10, config_default=100, max_cpus=100) == 10
def test_build_jobs_defaults(): assert determine_number_of_jobs(parallel=True, command_line=None, config_default=1, max_cpus=10) == 1 assert determine_number_of_jobs(parallel=True, command_line=None, config_default=100, max_cpus=10) == 10
def install(self, spec, prefix): """Install everything from build directory.""" raco = Executable("raco") with working_dir(self.build_directory): allow_parallel = self.parallel and (not env_flag(SPACK_NO_PARALLEL_MAKE)) args = ['pkg', 'install', '-t', 'dir', '-n', self.name, '--deps', 'fail', '--ignore-implies', '--copy', '-i', '-j', str(determine_number_of_jobs(allow_parallel)), '--', os.getcwd()] try: raco(*args) except ProcessError: args.insert(-2, "--skip-installed") raco(*args) tty.warn(("Racket package {0} was already installed, uninstalling via " "Spack may make someone unhappy!").format(self.name))
def test_build_jobs_sequential_is_sequential(): assert determine_number_of_jobs( parallel=False, command_line=8, config_default=8, max_cpus=8) == 1