anakryiko / btfdump

BTF introspection tool
BSD 2-Clause "Simplified" License
28 stars 7 forks source link

.github: add actions for CI and dependency updates #9

Closed tamird closed 1 year ago

tamird commented 1 year ago

/cc @ajwerner

tamird commented 1 year ago

I added some commits to update the dependencies to latest.

tamird commented 1 year ago

Thanks, sorry about that. i wanted to write an integration test but it seems that there's nothing currently set up for compiling the BTF and then dumping it.

EDIT: the test would look something like:


diff --git a/tests/tests.rs b/tests/tests.rs
new file mode 100644
index 0000000..8fee9f0
--- /dev/null
+++ b/tests/tests.rs
@@ -0,0 +1,43 @@
+#[test]
+fn dump() {
+    let mut cmd = std::process::Command::new(env!("CARGO_BIN_EXE_btf"));
+    let std::process::Output {
+        status,
+        stdout,
+        stderr,
+    } = cmd
+        .arg("dump")
+        .arg(path-to-btf)
+        .output()
+        .unwrap();
+    let stdout = std::str::from_utf8(&stdout);
+    let stderr = std::str::from_utf8(&stderr);
+    assert_eq!(
+        status.code(),
+        Some(0),
+        "{:?} failed: stdout={:?} stderr={:?}",
+        cmd,
+        stdout,
+        stderr
+    );
+}
``
anakryiko commented 1 year ago

Works now, thanks! Do you want me to create a new v0.0.4 release right away?

tamird commented 1 year ago

Yes, that would be helpful!

anakryiko commented 1 year ago

ok, release v0.0.4 is pushed out (https://github.com/anakryiko/btfdump/releases/tag/v0.0.4, https://crates.io/crates/btfdump/0.0.4)