changeset 68:be9b8751f568

Exclude /usr/src from coverage and use crate functions in tests
author Lewin Bormann <lbo@spheniscida.de>
date Sat, 31 Aug 2019 21:00:53 +0200
parents 31905126f204
children 694d965661c7
files coverage.sh src/tests.rs
diffstat 2 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/coverage.sh	Sat Aug 31 20:40:40 2019 +0200
+++ b/coverage.sh	Sat Aug 31 21:00:53 2019 +0200
@@ -2,7 +2,7 @@
 #!/bin/bash
 
 KCOV=kcov
-KCOV_OPTS="--verify --exclude-pattern=/.cargo,/glibc,/usr/lib,/usr/include"
+KCOV_OPTS="--verify --exclude-pattern=/.cargo,/glibc,/usr/lib,/usr/include,/usr/src"
 KCOV_OUT="./kcov-out/"
 
 export RUSTFLAGS="-C link-dead-code"
--- a/src/tests.rs	Sat Aug 31 20:40:40 2019 +0200
+++ b/src/tests.rs	Sat Aug 31 21:00:53 2019 +0200
@@ -5,10 +5,7 @@
 use crate::{compile, matching, parse, repr};
 
 fn match_re(re: &str, s: &str) -> (bool, Vec<(usize, usize)>) {
-    let parsed = parse::parse(re).unwrap();
-    let optimized = repr::optimize::optimize(parsed);
-    let ready = compile::start_compile(&optimized);
-    matching::do_match(&ready, s)
+    crate::match_re_str(re, s).unwrap()
 }
 
 #[test]