Skip to content

Commit

Permalink
Move KS tests (#1525)
Browse files Browse the repository at this point in the history
Adds new non-publishing distr_test crate
  • Loading branch information
benjamin-lieser authored Nov 18, 2024
1 parent 7fe350c commit e85c923
Show file tree
Hide file tree
Showing 14 changed files with 964 additions and 1,410 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/distr_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: distr_test

on:
pull_request:
paths:
- ".github/workflows/distr_test.yml"
- "distr_test/**"

jobs:
distr_test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./distr_test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: clippy, rustfmt
- name: Rustfmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ jobs:
- name: Test rand_chacha
run: cargo test --target ${{ matrix.target }} --manifest-path rand_chacha/Cargo.toml --features=serde

test-ks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
target: x86_64-unknown-linux-gnu
- name: Test Komogorov Smirnov
run: cargo test --manifest-path distr_test/Cargo.toml --release

test-cross:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ members = [
"rand_chacha",
"rand_pcg",
]
exclude = ["benches"]
exclude = ["benches", "distr_test"]

[dependencies]
rand_core = { path = "rand_core", version = "=0.9.0-alpha.1", default-features = false }
Expand Down
15 changes: 15 additions & 0 deletions distr_test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "distr_test"
version = "0.1.0"
edition = "2021"
publish = false

[dev-dependencies]
rand_distr = { path = "../rand_distr", version = "=0.5.0-alpha.1", default-features = false }
rand = { path = "..", version = "=0.9.0-alpha.1", features = ["small_rng"] }
num-traits = "0.2.19"
# Special functions for testing distributions
special = "0.11.0"
spfunc = "0.1.0"
# Cdf implementation
statrs = "0.17.1"
Loading

0 comments on commit e85c923

Please sign in to comment.