Skip to content

Commit 72efe47

Browse files
committed
feat: export llvm test utilities under llvm-test feature (#1677)
Closes #1673
1 parent 7cec0ad commit 72efe47

28 files changed

+339
-300
lines changed

.github/workflows/ci-rs.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,23 @@ keywords = ["Quantum", "Quantinuum"]
1616
categories = ["compilers"]
1717

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

2333
[dependencies]
2434
inkwell = { version = "0.4.0", default-features = false }
25-
hugr-core = { path = "../hugr-core", version = "0.13.3"}
35+
hugr-core = { path = "../hugr-core", version = "0.13.3" }
2636
anyhow = "1.0.83"
2737
itertools = "0.12.1"
2838
delegate = "0.12.0"
@@ -31,11 +41,13 @@ lazy_static = "1.4.0"
3141
downcast-rs= "1.2.1"
3242
strum = "0.26.3"
3343

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+
3452
[dev-dependencies]
35-
insta.workspace = true
36-
rstest.workspace = true
37-
portgraph.workspace = true
38-
pathsearch.workspace = true
39-
serde_json.workspace = true
40-
serde.workspace = true
41-
typetag.workspace = true
53+
hugr-llvm = {"path" = ".", features = ["test-utils"]}

hugr-llvm/src/emit.rs

Lines changed: 1 addition & 1 deletion
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)