mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-05-30 23:20:40 +00:00
Trying to fix travis code coverage
This commit is contained in:
@@ -34,5 +34,7 @@ script:
|
||||
travis-cargo bench &&
|
||||
travis-cargo doc
|
||||
after_success:
|
||||
- travis-cargo doc-upload
|
||||
- travis-cargo coveralls --no-sudo
|
||||
- travis-cargo doc-upload
|
||||
- travis-cargo coveralls --no-sudo
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then travis-cargo coveralls --no-sudo --verify; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./kcov/build/src/kcov --verify --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov target/debug/tantivy-6*; fi
|
||||
|
||||
@@ -32,9 +32,12 @@ rand = "0.3.13"
|
||||
gcc = "0.3.24"
|
||||
|
||||
[[bin]]
|
||||
name = "tantivy-merge"
|
||||
name = "tantivy_merge"
|
||||
path = "src/cli/merge.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "tantivy-bench"
|
||||
name = "tantivy_bench"
|
||||
path = "src/cli/bench.rs"
|
||||
|
||||
[profile.release]
|
||||
debug = true
|
||||
@@ -40,7 +40,8 @@ fn read_query_file(query_path: &String) -> io::Result<Vec<String>> {
|
||||
}
|
||||
|
||||
fn run(directory: String,
|
||||
query_filepath: String) -> io::Result<()> {
|
||||
query_filepath: String,
|
||||
num_repeat: usize) -> io::Result<()> {
|
||||
println!("Directory : {:?}", directory);
|
||||
println!("Query : {:?}", directory);
|
||||
|
||||
@@ -55,7 +56,7 @@ fn run(directory: String,
|
||||
let query_parser = QueryParser::new(index.schema(), default_search_fields);
|
||||
|
||||
println!("{}\t{}\t{}\t{}", "query", "num_terms", "num hits", "time in microsecs");
|
||||
for _ in 0..10 {
|
||||
for _ in 0..num_repeat {
|
||||
for query_txt in &queries {
|
||||
let query = query_parser.parse_query(&query_txt).unwrap();
|
||||
let num_terms = query.num_terms();
|
||||
@@ -75,6 +76,7 @@ fn run(directory: String,
|
||||
fn main() {
|
||||
let mut directory = String::from(".");
|
||||
let mut query_file = String::from("query.txt");
|
||||
let mut repeat: usize = 1;
|
||||
{
|
||||
let mut ap = ArgumentParser::new();
|
||||
ap.set_description("Merge a few segments together");
|
||||
@@ -86,7 +88,11 @@ fn main() {
|
||||
.add_option(&["-q", "--queries"],
|
||||
Store,
|
||||
"Path to the tantivy index directory");
|
||||
ap.refer(&mut repeat)
|
||||
.add_option(&["-n", "--repeat"],
|
||||
Store,
|
||||
"Number of iterations");
|
||||
ap.parse_args_or_exit();
|
||||
}
|
||||
run(directory, query_file).unwrap();
|
||||
run(directory, query_file, repeat).unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user