Skip to content

Commit

Permalink
Debugging CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
PaDarochek committed Dec 8, 2023
1 parent af82750 commit 4b0276c
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions casr/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5402,7 +5402,7 @@ fn test_casr_libfuzzer_jazzer_js_xml2js() {
.expect("failed to create dir");
assert!(
output.status.success(),
"Stdout {}.\n Stderr: {}",
"Stdout: {}.\n Stderr: {}",
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
);
Expand All @@ -5420,15 +5420,39 @@ fn test_casr_libfuzzer_jazzer_js_xml2js() {
panic!("No npm is found.");
};

let npm = Command::new(npm_path)
.current_dir(&test_dir)
let mut npm = Command::new(&npm_path)
.stdin(Stdio::piped())
.stdout(Stdio::null())
.stderr(Stdio::null())
.current_dir(&test_dir)
.env("CC", "clang")
.env("CXX", "clang++")
.arg("init")
.arg("-y")
.spawn()
.expect("failed to run npm init");

let mut stdin = npm.stdin.take().expect("failed to open stdin");
stdin
.write_all("\n\n\n\n\n\n\n\n".as_bytes())
.expect("failed to write to stdin");

npm.wait().expect("failed to run npm init");

let npm = Command::new("bash")
.current_dir(&test_dir)
// .stdout(Stdio::null())
// .stderr(Stdio::null())
.arg("-c")
.args(["install", "xml2js"])
.status()
.arg(format!("{} install xml2js", &npm_path.display()))
.output()
.expect("failed to install xml2js");
assert!(npm.success());
// assert!(npm.success());
assert!(
npm.status.success(),
"Stdout: {}.\n Stderr: {}",
String::from_utf8_lossy(&npm.stdout),
String::from_utf8_lossy(&npm.stderr)
);

let Ok(npx_path) = which::which("npx") else {
panic!("No npx is found.");
Expand Down

0 comments on commit 4b0276c

Please sign in to comment.