From 38c2d93c0a32a35bc7cc4937bcb31277a5839187 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 20 Feb 2020 11:35:04 -0500 Subject: [PATCH] Attempt CI coverage report --- Jenkinsfile | 11 +++++++++++ src/rational.rs | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a99de90..1f11da4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,5 +15,16 @@ pipeline { sh "cargo test" } } + stage('Coverage') { + steps { + sh "cargo install cargo-tarpaulin" + sh "make coverage" + } + } + } + post { + always { + cobertura coberturaReportFile: '*/.xml' + } } } \ No newline at end of file diff --git a/src/rational.rs b/src/rational.rs index d108427..613374b 100644 --- a/src/rational.rs +++ b/src/rational.rs @@ -30,7 +30,6 @@ pub struct Frac { sign: Sign, } -#[macro_export] /// Create a [Frac](rational/struct.Frac.html) type with signed or unsigned number literals /// /// Example: @@ -49,6 +48,7 @@ pub struct Frac { /// // Whole numbers and fractions /// frac!(1 1/2); /// ``` +#[macro_export] macro_rules! frac { ($w:literal $n:literal / $d:literal) => { frac!($w) + frac!($n / $d)