Skip to content

Commit

Permalink
feat: export llvm test utilities under llvm-test feature (#1677)
Browse files Browse the repository at this point in the history
Closes #1673
  • Loading branch information
ss2165 committed Nov 22, 2024
1 parent 7cec0ad commit 72efe47
Show file tree
Hide file tree
Showing 28 changed files with 339 additions and 300 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ jobs:

tests-stable-llvm:
needs: changes
if: ${{ ( needs.changes.outputs.llvm == 'true' && github.event_name == 'push' ) || needs.changes.outputs.override == 'true' }}
if: ${{ ( needs.changes.outputs.llvm == 'true' && github.event_name == 'push' ) || needs.changes.outputs.override == 'true' }}
runs-on: ubuntu-latest
name: tests hugr-llvm
strategy:
Expand Down
32 changes: 22 additions & 10 deletions hugr-llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,23 @@ keywords = ["Quantum", "Quantinuum"]
categories = ["compilers"]

[features]
default = ["llvm14-0", "tket2"]
test-utils = [
"insta",
"rstest",
"portgraph",
"pathsearch",
"serde_json",
"serde",
"typetag",
]

default = ["llvm14-0"]
llvm14-0 = ["inkwell/llvm14-0"]
tket2 = ["dep:tket2"]


[dependencies]
inkwell = { version = "0.4.0", default-features = false }
hugr-core = { path = "../hugr-core", version = "0.13.3"}
hugr-core = { path = "../hugr-core", version = "0.13.3" }
anyhow = "1.0.83"
itertools = "0.12.1"
delegate = "0.12.0"
Expand All @@ -31,11 +41,13 @@ lazy_static = "1.4.0"
downcast-rs= "1.2.1"
strum = "0.26.3"

insta = { workspace = true, optional = true }
rstest = { workspace = true, optional = true }
portgraph = { workspace = true, optional = true }
pathsearch = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
typetag = { workspace = true, optional = true }

[dev-dependencies]
insta.workspace = true
rstest.workspace = true
portgraph.workspace = true
pathsearch.workspace = true
serde_json.workspace = true
serde.workspace = true
typetag.workspace = true
hugr-llvm = {"path" = ".", features = ["test-utils"]}
2 changes: 1 addition & 1 deletion hugr-llvm/src/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,5 @@ pub fn get_intrinsic<'c>(
))
}

#[cfg(test)]
#[cfg(any(test, feature = "test-utils"))]
pub mod test;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 72efe47

Please sign in to comment.