Skip to content

Commit

Permalink
move hir-tree to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
high-cloud committed Mar 13, 2024
1 parent 9ce37dc commit b24f68f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;
use std::ffi::OsStr;
use std::path::{Path, PathBuf};
use std::process::{Command, Output};

pub use wasmparser;

pub fn out_dir() -> PathBuf {
Expand Down Expand Up @@ -43,7 +43,7 @@ impl RustcInvocationBuilder {
Self { cmd }
}

pub fn arg(&mut self, arg: &str) -> &mut RustcInvocationBuilder {
pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut RustcInvocationBuilder {
self.cmd.arg(arg);
self
}
Expand Down
8 changes: 0 additions & 8 deletions tests/run-make/hir-tree/Makefile

This file was deleted.

17 changes: 17 additions & 0 deletions tests/run-make/hir-tree/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extern crate run_make_support;

use run_make_support::{out_dir, rustc};

// Test that hir-tree output doesn't crash and includes
// the string constant we would expect to see.

fn main() {
rustc()
.arg("-o")
.arg(&out_dir().join("input.hir"))
.arg("-Zunpretty=hir-tree")
.arg("input.rs")
.run();
let file = std::fs::read_to_string(&out_dir().join("input.hir")).unwrap();
assert!(file.contains(r#""Hello, Rustaceans!\n""#));
}

0 comments on commit b24f68f

Please sign in to comment.