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