Skip to content

Commit 78435b5

Browse files
authored
feat: export llvm test utilities under llvm-test feature (#1677)
Closes #1673
1 parent 1b94d45 commit 78435b5

28 files changed

+338
-298
lines changed

.github/workflows/ci-rs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ jobs:
242242

243243
tests-stable-llvm:
244244
needs: changes
245-
if: ${{ ( needs.changes.outputs.llvm == 'true' && github.event_name == 'push' ) || needs.changes.outputs.override == 'true' }}
245+
if: ${{ ( needs.changes.outputs.llvm == 'true' && github.event_name == 'push' ) || needs.changes.outputs.override == 'true' }}
246246
runs-on: ubuntu-latest
247247
name: tests hugr-llvm
248248
strategy:

hugr-llvm/Cargo.toml

+21-8
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,23 @@ keywords = ["Quantum", "Quantinuum"]
1616
categories = ["compilers"]
1717

1818
[features]
19+
test-utils = [
20+
"insta",
21+
"rstest",
22+
"portgraph",
23+
"pathsearch",
24+
"serde_json",
25+
"serde",
26+
"typetag",
27+
]
28+
1929
default = ["llvm14-0"]
2030
llvm14-0 = ["inkwell/llvm14-0"]
2131

32+
2233
[dependencies]
2334
inkwell = { version = "0.4.0", default-features = false }
24-
hugr-core = { path = "../hugr-core", version = "0.13.3"}
35+
hugr-core = { path = "../hugr-core", version = "0.13.3" }
2536
anyhow = "1.0.83"
2637
itertools.workspace = true
2738
delegate.workspace = true
@@ -30,11 +41,13 @@ lazy_static.workspace = true
3041
downcast-rs.workspace = true
3142
strum.workspace = true
3243

44+
insta = { workspace = true, optional = true }
45+
rstest = { workspace = true, optional = true }
46+
portgraph = { workspace = true, optional = true }
47+
pathsearch = { workspace = true, optional = true }
48+
serde_json = { workspace = true, optional = true }
49+
serde = { workspace = true, optional = true }
50+
typetag = { workspace = true, optional = true }
51+
3352
[dev-dependencies]
34-
insta.workspace = true
35-
rstest.workspace = true
36-
portgraph.workspace = true
37-
pathsearch.workspace = true
38-
serde_json.workspace = true
39-
serde.workspace = true
40-
typetag.workspace = true
53+
hugr-llvm = {"path" = ".", features = ["test-utils"]}

hugr-llvm/src/emit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,5 +403,5 @@ pub fn get_intrinsic<'c>(
403403
))
404404
}
405405

406-
#[cfg(test)]
406+
#[cfg(any(test, feature = "test-utils"))]
407407
pub mod test;

0 commit comments

Comments
 (0)