summaryrefslogtreecommitdiff
path: root/rust/test_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/test_test.go')
-rw-r--r--rust/test_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/rust/test_test.go b/rust/test_test.go
index fea2ad059..892761a07 100644
--- a/rust/test_test.go
+++ b/rust/test_test.go
@@ -26,6 +26,7 @@ func TestRustTest(t *testing.T) {
rust_test_host {
name: "my_test",
srcs: ["foo.rs"],
+ data: ["data.txt"],
}`)
testingModule := ctx.ModuleForTests("my_test", "linux_glibc_x86_64")
@@ -34,6 +35,12 @@ func TestRustTest(t *testing.T) {
if !strings.Contains(outPath, expectedOut) {
t.Errorf("wrong output path: %v; expected: %v", outPath, expectedOut)
}
+
+ dataPaths := testingModule.Module().(*Module).compiler.(*testDecorator).dataPaths()
+ if len(dataPaths) != 1 {
+ t.Errorf("expected exactly one test data file. test data files: [%s]", dataPaths)
+ return
+ }
}
func TestRustTestLinkage(t *testing.T) {