未验证 提交 44954ab5 编写于 作者: K kennytm

Clarify toolstate names. Move publish.py to a more convenient location.

上级 d7488c30
......@@ -188,7 +188,7 @@ matrix:
script:
MESSAGE_FILE=$(mktemp -t msg.XXXXXX);
. src/ci/docker/x86_64-gnu-tools/repo.sh;
commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/ci/docker/x86_64-gnu-tools/publish.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE"
commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE"
env:
global:
......
......@@ -256,7 +256,7 @@ fn run(self, builder: &Builder) {
builder.add_rustc_lib_path(compiler, &mut cargo);
if try_run(build, &mut cargo) {
build.save_toolstate("rls", ToolState::Testing);
build.save_toolstate("rls", ToolState::TestPass);
}
}
}
......@@ -302,7 +302,7 @@ fn run(self, builder: &Builder) {
builder.add_rustc_lib_path(compiler, &mut cargo);
if try_run(build, &mut cargo) {
build.save_toolstate("rustfmt", ToolState::Testing);
build.save_toolstate("rustfmt", ToolState::TestPass);
}
}
}
......@@ -352,7 +352,7 @@ fn run(self, builder: &Builder) {
builder.add_rustc_lib_path(compiler, &mut cargo);
if try_run(build, &mut cargo) {
build.save_toolstate("miri", ToolState::Testing);
build.save_toolstate("miri", ToolState::TestPass);
}
} else {
eprintln!("failed to test miri: could not build");
......@@ -407,7 +407,7 @@ fn run(self, builder: &Builder) {
builder.add_rustc_lib_path(compiler, &mut cargo);
if try_run(build, &mut cargo) {
build.save_toolstate("clippy-driver", ToolState::Testing);
build.save_toolstate("clippy-driver", ToolState::TestPass);
}
} else {
eprintln!("failed to test clippy: could not build");
......
......@@ -116,9 +116,9 @@ fn run(self, builder: &Builder) -> Option<PathBuf> {
let mut cargo = prepare_tool_cargo(builder, compiler, target, "build", path);
let is_expected = build.try_run(&mut cargo);
build.save_toolstate(tool, if is_expected {
ToolState::Compiling
ToolState::TestFail
} else {
ToolState::Broken
ToolState::BuildFail
});
if !is_expected {
......
......@@ -9,19 +9,20 @@
// except according to those terms.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
/// Whether a tool can be compiled, tested or neither
pub enum ToolState {
/// The tool compiles successfully, but the test suite fails
Compiling = 1,
TestFail = 1,
/// The tool compiles successfully and its test suite passes
Testing = 2,
TestPass = 2,
/// The tool can't even be compiled
Broken = 0,
BuildFail = 0,
}
impl Default for ToolState {
fn default() -> Self {
// err on the safe side
ToolState::Broken
ToolState::BuildFail
}
}
......@@ -41,6 +41,6 @@ $COMMIT\t$(cat "$TOOLSTATE_FILE")
exit 0
fi
if grep -q 'Broken\|Compiling' "$TOOLSTATE_FILE"; then
if grep -q fail "$TOOLSTATE_FILE"; then
exit 4
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册