about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIlan Joselevich <personal@ilanjoselevich.com>2024-06-05T15·56+0300
committerclbot <clbot@tvl.fyi>2024-06-05T17·52+0000
commit34d93f1d9611ca110d71ebf7430df646247270dc (patch)
tree9d23c9878b1aa8a5579ecf9492661ec96d04cea1
parent72b9a126b81d9d41557c233387708c2bb640d13b (diff)
fix(tvix): make rstest pick up new test case files r/8218
Context: https://github.com/la10736/rstest/issues/256

Cargo will now cause a rebuild whenever a new test case file is added.
Previsouly running `cargo test` after adding a new test case resulted in
that case not being picked up and ignored.

Change-Id: Ibfc420b5bfe3f3ee41d3ebd3fb9d248819fa6ed9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11751
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com>
-rw-r--r--tvix/eval/build.rs7
-rw-r--r--tvix/glue/build.rs6
-rw-r--r--tvix/nix-compat/build.rs5
3 files changed, 17 insertions, 1 deletions
diff --git a/tvix/eval/build.rs b/tvix/eval/build.rs
index a9c9a78b060d..b37a6e8a0c8d 100644
--- a/tvix/eval/build.rs
+++ b/tvix/eval/build.rs
@@ -5,5 +5,10 @@ fn main() {
         "cargo:rustc-env=TVIX_CURRENT_SYSTEM={}",
         &env::var("TARGET").unwrap()
     );
-    println!("cargo:rerun-if-changed-env=TARGET")
+    println!("cargo:rerun-if-changed-env=TARGET");
+
+    // Pick up new test case files
+    // https://github.com/la10736/rstest/issues/256
+    println!("cargo:rerun-if-changed=src/tests/nix_tests");
+    println!("cargo:rerun-if-changed=src/tests/tvix_tests")
 }
diff --git a/tvix/glue/build.rs b/tvix/glue/build.rs
new file mode 100644
index 000000000000..544c34a6cbcb
--- /dev/null
+++ b/tvix/glue/build.rs
@@ -0,0 +1,6 @@
+fn main() {
+    // Pick up new test case files
+    // https://github.com/la10736/rstest/issues/256
+    println!("cargo:rerun-if-changed=src/tests/nix_tests");
+    println!("cargo:rerun-if-changed=src/tests/tvix_tests")
+}
diff --git a/tvix/nix-compat/build.rs b/tvix/nix-compat/build.rs
new file mode 100644
index 000000000000..c66b97016245
--- /dev/null
+++ b/tvix/nix-compat/build.rs
@@ -0,0 +1,5 @@
+fn main() {
+    // Pick up new test case files
+    // https://github.com/la10736/rstest/issues/256
+    println!("cargo:rerun-if-changed=src/derivation/tests/derivation_tests")
+}