nextest_metadata/
exit_codes.rs

1// Copyright (c) The nextest Contributors
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4/// Documented exit codes for `cargo nextest` failures.
5///
6/// `cargo nextest` runs may fail for a variety of reasons. This structure documents the exit codes
7/// that may occur in case of expected failures.
8///
9/// Unknown/unexpected failures will always result in exit code 1.
10pub enum NextestExitCode {}
11
12impl NextestExitCode {
13    /// Running `cargo metadata` produced an error.
14    pub const CARGO_METADATA_FAILED: i32 = 102;
15
16    /// Building tests produced an error.
17    pub const BUILD_FAILED: i32 = 101;
18
19    /// An error was encountered while attempting to double-spawn a nextest process.
20    pub const DOUBLE_SPAWN_ERROR: i32 = 70;
21
22    /// No tests were selected to run, but no other errors occurred.
23    ///
24    /// This is an advisory exit code generated if nextest is run with `--no-tests=fail` (soon to
25    /// become the default). See [discussion #1646] for more.
26    ///
27    /// [discussion #1646]: https://github.com/nextest-rs/nextest/discussions/1646
28    pub const NO_TESTS_RUN: i32 = 4;
29
30    /// One or more tests failed.
31    pub const TEST_RUN_FAILED: i32 = 100;
32
33    /// Creating an archive produced an error.
34    pub const ARCHIVE_CREATION_FAILED: i32 = 103;
35
36    /// Creating a test list produced an error.
37    pub const TEST_LIST_CREATION_FAILED: i32 = 104;
38
39    /// A setup script failed.
40    pub const SETUP_SCRIPT_FAILED: i32 = 105;
41
42    /// Writing data to stdout or stderr produced an error.
43    pub const WRITE_OUTPUT_ERROR: i32 = 110;
44
45    /// Downloading an update resulted in an error.
46    pub const UPDATE_ERROR: i32 = 90;
47
48    /// An update was available and `--check` was requested.
49    pub const UPDATE_AVAILABLE: i32 = 80;
50
51    /// A downgrade was requested but not performed.
52    pub const UPDATE_DOWNGRADE_NOT_PERFORMED: i32 = 81;
53
54    // TODO: change this to UPDATE_CANCELLED
55    /// An update was available but the user cancelled it.
56    pub const UPDATE_CANCELED: i32 = 82;
57
58    /// A user issue happened while setting up a nextest invocation.
59    pub const SETUP_ERROR: i32 = 96;
60
61    /// An experimental feature was used without the environment variable to enable it.
62    pub const EXPERIMENTAL_FEATURE_NOT_ENABLED: i32 = 95;
63
64    /// A filterset failed to parse.
65    pub const INVALID_FILTERSET: i32 = 94;
66
67    /// A self-update was requested but this version of cargo-nextest cannot perform self-updates.
68    pub const SELF_UPDATE_UNAVAILABLE: i32 = 93;
69
70    /// The current version of nextest did not meet repository or tool requirements.
71    ///
72    /// *Since nextest 0.9.55*.
73    pub const REQUIRED_VERSION_NOT_MET: i32 = 92;
74
75    /// The current version of nextest is older than the minimum recommended version.
76    ///
77    /// This advisory exit code is only produced by `cargo nextest show-config version`.
78    ///
79    /// *Since nextest 0.9.55*.
80    pub const RECOMMENDED_VERSION_NOT_MET: i32 = 10;
81}