Skip to content

Support negative --test-threads/--jobs parameter #495

@sunshowers

Description

@sunshowers

Port over rust-lang/cargo#10844.

This is a great first issue and should take no more than a few hours to complete :) Here's the recommended series of steps:

  1. Update the TestThreads parser and deserializer to handle negative integers:
    /// Type for the test-threads config key.
    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
    pub enum TestThreads {
    /// Run tests with a specified number of threads.
    Count(usize),
    /// Run tests with a number of threads equal to the logical CPU count.
    NumCpus,
    }

    Use the logic at https://github.com/rust-lang/cargo/pull/10844/files#diff-f0c6e0ba24dc1403233aec133c8788a36c21b097514ea69994ff35253a07802a.
  2. Add unit tests for this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions