mirror of
https://github.com/uutils/awk.git
synced 2026-06-10 16:15:04 -07:00
test: add uutests-based smoke tests
This commit is contained in:
Generated
+1046
-5
File diff suppressed because it is too large
Load Diff
@@ -45,6 +45,10 @@ rustix = { version = "1.1.4", default-features = false, features = ["process"]}
|
||||
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
|
||||
tracing-error = "0.2.1"
|
||||
|
||||
[dev-dependencies]
|
||||
ctor = "0.4"
|
||||
uutests = "0.8"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
panic = "abort"
|
||||
|
||||
@@ -1 +1,16 @@
|
||||
use std::env;
|
||||
|
||||
pub const TESTS_BINARY: &str = env!("CARGO_BIN_EXE_awk");
|
||||
|
||||
#[ctor::ctor]
|
||||
fn init() {
|
||||
unsafe {
|
||||
env::set_var("UUTESTS_BINARY_PATH", TESTS_BINARY);
|
||||
env::remove_var("UUTESTS_UTIL_NAME");
|
||||
env::set_var("UUTESTS_UTIL_NAME", "");
|
||||
env::set_var("UUTILS_MULTICALL", "0");
|
||||
}
|
||||
}
|
||||
|
||||
#[path = "by-util/test_awk.rs"]
|
||||
mod test_awk;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
use uutests::new_ucmd;
|
||||
|
||||
#[test]
|
||||
fn empty_program_succeeds() {
|
||||
new_ucmd!().arg("").succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "parser does not yet support print/field expressions"]
|
||||
fn print_first_field() {
|
||||
new_ucmd!().arg("{ print $1 }").succeeds();
|
||||
}
|
||||
Reference in New Issue
Block a user