wgpu/cts_runner/tests/integration.rs
Luca Casonato d5ba0b439d
WIP: add cts_runner and deno_webgpu crate (#1859)
* WIP: add cts_runner and deno_webgpu crate

* add test

* remove Cargo.lock

* review comment

* simplify

* fix bugs

* improve cts_runner to work with crowlKats/webgpu-examples

* fix

* remove build.rs

cts_runner binaries are now not portable anymore.

Also startup will now print a bunch of cargo:rerun-if-changed=. This
will be fixed in deno_core.

* remove d.ts

* add original deno license file
2021-09-03 13:23:35 -04:00

28 lines
712 B
Rust

use std::path::PathBuf;
pub fn target_dir() -> PathBuf {
let current_exe = std::env::current_exe().unwrap();
let target_dir = current_exe.parent().unwrap().parent().unwrap();
target_dir.into()
}
pub fn cts_runner_exe_path() -> PathBuf {
// Something like /Users/lucacasonato/src/wgpu/target/debug/cts_runner
let mut p = target_dir().join("cts_runner");
if cfg!(windows) {
p.set_extension("exe");
}
p
}
#[test]
fn hello_compute_example() {
let output = std::process::Command::new(cts_runner_exe_path())
.arg("examples/hello-compute.js")
.spawn()
.unwrap()
.wait_with_output()
.unwrap();
assert!(output.status.success())
}