Adds CI support.
continuous-integration/drone/push Build is failing Details
continuous-integration/drone Build is passing Details

This commit is contained in:
Deukhoofd 2022-06-11 18:56:17 +02:00
parent 6e8f4dd4a5
commit 3c1fc4615f
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 33 additions and 1 deletions

28
.drone.yml Normal file
View File

@ -0,0 +1,28 @@
---
kind: pipeline
name: default
type: docker
steps:
- name: test-debug-linux
image: deukhoofd/linux64builder
commands:
- cargo nextest run
- name: test-release-linux
image: deukhoofd/linux64builder
commands:
- cargo nextest run --release
depends_on:
- test-debug-linux
- name: test-miri-release-linux
image: deukhoofd/linux64builder
commands:
- cargo miri test --release
depends_on:
- test-debug-linux
- name: test-coverage
image: deukhoofd/linux64builder
commands:
- cargo llvm-cov nextest
depends_on:
- test-debug-linux

View File

@ -77,6 +77,7 @@ mod tests {
use test::Bencher;
#[test]
#[cfg_attr(miri, ignore)]
fn create_random() {
let _default = Random::default();
let _empty = Random::new(100);
@ -132,6 +133,7 @@ mod tests {
}
#[test]
#[cfg_attr(miri, ignore)]
fn check_random_distribution() {
let mut v = Random::new(10);
const AMOUNT: usize = 100_000;
@ -155,6 +157,7 @@ mod tests {
}
#[test]
#[cfg_attr(miri, ignore)]
fn check_random_distribution_0_to_3() {
let mut v = Random::new(10);
const AMOUNT: usize = 100_000;
@ -182,9 +185,10 @@ mod tests {
}
#[bench]
#[cfg_attr(miri, ignore)]
fn bench_1000_random_ints_between(b: &mut Bencher) {
b.iter(|| {
let mut random = Random::default();
let mut random = Random::new(10);
for _ in 0..1000 {
black_box(random.get_between(0, 100));
}