aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@yahooinc.com>2024-06-20 13:16:55 +0000
committerHåvard Pettersen <havardpe@yahooinc.com>2024-06-20 13:56:01 +0000
commit17310d027c73c694d034472c2f9a81985eb0cd68 (patch)
treeb7fd10381286bc67e3f5ce1d7fcb55fd32df9428 /searchlib
parentdf84441bbfb66161bf823f9235532083ce58b1bc (diff)
remove TEST_APPHOOK, TEST_INIT, TEST_DONE and TestApp
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/apps/tests/memoryindexstress_test.cpp2
-rw-r--r--searchlib/src/tests/aggregator/perdocexpr_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/attribute_operation/attribute_operation_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/attributefilewriter/attributefilewriter_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/changevector/changevector_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp2
-rw-r--r--searchlib/src/tests/bitcompression/expgolomb/expgolomb_test.cpp2
-rw-r--r--searchlib/src/tests/common/bitvector/bitvector_benchmark.cpp2
-rw-r--r--searchlib/src/tests/common/bitvector/bitvector_test.cpp2
-rw-r--r--searchlib/src/tests/common/bitvector/condensedbitvector_test.cpp2
-rw-r--r--searchlib/src/tests/common/resultset/resultset_test.cpp2
-rw-r--r--searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp2
-rw-r--r--searchlib/src/tests/expression/attributenode/attribute_node_test.cpp2
-rw-r--r--searchlib/src/tests/fef/featureoverride/featureoverride_test.cpp2
-rw-r--r--searchlib/src/tests/fef/fef_test.cpp2
-rw-r--r--searchlib/src/tests/fileheadertk/fileheadertk_test.cpp2
-rw-r--r--searchlib/src/tests/grouping/grouping_test.cpp2
-rw-r--r--searchlib/src/tests/grouping/hyperloglog_test.cpp2
-rw-r--r--searchlib/src/tests/grouping/sketch_test.cpp2
-rw-r--r--searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp71
-rw-r--r--searchlib/src/tests/groupingengine/groupingengine_test.cpp187
-rw-r--r--searchlib/src/tests/predicate/document_features_store_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_index_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_interval_store_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_range_term_expander_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_ref_cache_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_tree_analyzer_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/simple_index_test.cpp2
-rw-r--r--searchlib/src/tests/predicate/tree_crumbs_test.cpp2
-rw-r--r--searchlib/src/tests/query/customtypevisitor_test.cpp2
-rw-r--r--searchlib/src/tests/query/query_visitor_test.cpp2
-rw-r--r--searchlib/src/tests/query/stackdumpquerycreator_test.cpp2
-rw-r--r--searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp2
-rw-r--r--searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp2
-rw-r--r--searchlib/src/tests/queryeval/getnodeweight/getnodeweight_test.cpp2
-rw-r--r--searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp57
-rw-r--r--searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp2
-rw-r--r--searchlib/src/tests/queryeval/predicate/predicate_search_test.cpp2
-rw-r--r--searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp178
-rw-r--r--searchlib/src/tests/sort/sort_test.cpp2
-rw-r--r--searchlib/src/tests/sort/sortbenchmark.cpp40
-rw-r--r--searchlib/src/tests/sortspec/multilevelsort_test.cpp2
-rw-r--r--searchlib/src/tests/transactionlog/chunks_test.cpp2
-rw-r--r--searchlib/src/tests/transactionlog/translogclient_test.cpp2
-rw-r--r--searchlib/src/tests/util/bufferwriter/bufferwriter_test.cpp2
-rw-r--r--searchlib/src/tests/util/rawbuf_test.cpp2
55 files changed, 255 insertions, 378 deletions
diff --git a/searchlib/src/apps/tests/memoryindexstress_test.cpp b/searchlib/src/apps/tests/memoryindexstress_test.cpp
index 763ba860fe6..b9c80a3c04d 100644
--- a/searchlib/src/apps/tests/memoryindexstress_test.cpp
+++ b/searchlib/src/apps/tests/memoryindexstress_test.cpp
@@ -21,7 +21,7 @@
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/repo/fixedtyperepo.h>
#include <vespa/vespalib/util/rand48.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/util/sequencedtaskexecutor.h>
#include <vespa/vespalib/util/size_literals.h>
diff --git a/searchlib/src/tests/aggregator/perdocexpr_test.cpp b/searchlib/src/tests/aggregator/perdocexpr_test.cpp
index e9f0981739c..61c5a4f8de9 100644
--- a/searchlib/src/tests/aggregator/perdocexpr_test.cpp
+++ b/searchlib/src/tests/aggregator/perdocexpr_test.cpp
@@ -7,7 +7,7 @@
#include <vespa/searchlib/attribute/singleboolattribute.h>
#include <vespa/searchcommon/attribute/config.h>
#include <vespa/vespalib/objects/objectdumper.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/document/base/testdocman.h>
#include <vespa/document/fieldvalue/bytefieldvalue.h>
#include <vespa/document/fieldvalue/weightedsetfieldvalue.h>
diff --git a/searchlib/src/tests/attribute/attribute_operation/attribute_operation_test.cpp b/searchlib/src/tests/attribute/attribute_operation/attribute_operation_test.cpp
index 733c9e1a574..7589663073f 100644
--- a/searchlib/src/tests/attribute/attribute_operation/attribute_operation_test.cpp
+++ b/searchlib/src/tests/attribute/attribute_operation/attribute_operation_test.cpp
@@ -5,7 +5,7 @@
#include <vespa/searchlib/attribute/attribute.h>
#include <vespa/searchlib/common/bitvector.h>
#include <vespa/searchcommon/attribute/config.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("attribute_operation_test");
diff --git a/searchlib/src/tests/attribute/attributefilewriter/attributefilewriter_test.cpp b/searchlib/src/tests/attribute/attributefilewriter/attributefilewriter_test.cpp
index e8d95eab7e2..56117fdd17f 100644
--- a/searchlib/src/tests/attribute/attributefilewriter/attributefilewriter_test.cpp
+++ b/searchlib/src/tests/attribute/attributefilewriter/attributefilewriter_test.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/attribute/attributefilewriter.h>
#include <vespa/searchlib/attribute/attributefilebufferwriter.h>
#include <vespa/searchlib/attribute/attribute_header.h>
diff --git a/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp b/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp
index c3254cf930d..2494b514c56 100644
--- a/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp
+++ b/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp
@@ -7,7 +7,7 @@
#include <vespa/searchlib/attribute/configconverter.h>
#include <vespa/searchlib/attribute/multinumericattribute.h>
#include <vespa/searchlib/attribute/multinumericattribute.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("attribute_test");
diff --git a/searchlib/src/tests/attribute/changevector/changevector_test.cpp b/searchlib/src/tests/attribute/changevector/changevector_test.cpp
index ff0b358ea2e..9dd96b1b72c 100644
--- a/searchlib/src/tests/attribute/changevector/changevector_test.cpp
+++ b/searchlib/src/tests/attribute/changevector/changevector_test.cpp
@@ -1,5 +1,5 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/attribute/changevector.hpp>
#include <vespa/vespalib/stllike/hash_set.h>
diff --git a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp
index 0795d85e4a2..431d09a8665 100644
--- a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp
+++ b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp
@@ -19,7 +19,7 @@
#include <vespa/document/fieldvalue/intfieldvalue.h>
#include <vespa/document/fieldvalue/stringfieldvalue.h>
#include <vespa/vespalib/data/databuffer.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/compress.h>
#include <vespa/vespalib/util/memory.h>
#include <vespa/vespalib/stllike/asciistream.h>
diff --git a/searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp b/searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp
index fb733db5f71..868c85c7962 100644
--- a/searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp
+++ b/searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/attribute/posting_list_merger.h>
#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/vespalib/util/size_literals.h>
diff --git a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp
index 7a794795cce..0278c4f32ef 100644
--- a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp
+++ b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp
@@ -1,5 +1,5 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/attribute/attribute_blueprint_factory.h>
#include <vespa/searchlib/attribute/attribute_weighted_set_blueprint.h>
#include <vespa/searchlib/attribute/attributecontext.h>
diff --git a/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp b/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp
index 1bfb9fb41f9..b558c50488a 100644
--- a/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp
+++ b/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp
@@ -1,5 +1,5 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchcommon/attribute/config.h>
#include <vespa/searchlib/attribute/enumstore.h>
#include <vespa/searchlib/attribute/singlestringattribute.h>
diff --git a/searchlib/src/tests/bitcompression/expgolomb/expgolomb_test.cpp b/searchlib/src/tests/bitcompression/expgolomb/expgolomb_test.cpp
index 03cef8c8079..6857ca93e6e 100644
--- a/searchlib/src/tests/bitcompression/expgolomb/expgolomb_test.cpp
+++ b/searchlib/src/tests/bitcompression/expgolomb/expgolomb_test.cpp
@@ -1,7 +1,7 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/searchlib/bitcompression/compression.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/size_literals.h>
#include <vector>
#include <algorithm>
diff --git a/searchlib/src/tests/common/bitvector/bitvector_benchmark.cpp b/searchlib/src/tests/common/bitvector/bitvector_benchmark.cpp
index d111a392270..2600ebedbee 100644
--- a/searchlib/src/tests/common/bitvector/bitvector_benchmark.cpp
+++ b/searchlib/src/tests/common/bitvector/bitvector_benchmark.cpp
@@ -1,7 +1,7 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/log/log.h>
LOG_SETUP("bitvector_benchmark");
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/common/bitvector.h>
using namespace search;
diff --git a/searchlib/src/tests/common/bitvector/bitvector_test.cpp b/searchlib/src/tests/common/bitvector/bitvector_test.cpp
index 758f44cdba2..ef9e801cda3 100644
--- a/searchlib/src/tests/common/bitvector/bitvector_test.cpp
+++ b/searchlib/src/tests/common/bitvector/bitvector_test.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/searchlib/common/growablebitvector.h>
#include <vespa/searchlib/common/partialbitvector.h>
diff --git a/searchlib/src/tests/common/bitvector/condensedbitvector_test.cpp b/searchlib/src/tests/common/bitvector/condensedbitvector_test.cpp
index f4bbb0fe7ca..4f7a0dfa736 100644
--- a/searchlib/src/tests/common/bitvector/condensedbitvector_test.cpp
+++ b/searchlib/src/tests/common/bitvector/condensedbitvector_test.cpp
@@ -1,5 +1,5 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/common/condensedbitvectors.h>
#include <vespa/log/log.h>
diff --git a/searchlib/src/tests/common/resultset/resultset_test.cpp b/searchlib/src/tests/common/resultset/resultset_test.cpp
index d8cba35a96c..d757785206a 100644
--- a/searchlib/src/tests/common/resultset/resultset_test.cpp
+++ b/searchlib/src/tests/common/resultset/resultset_test.cpp
@@ -6,7 +6,7 @@ LOG_SETUP("resultset_test");
#include <vespa/searchlib/common/bitvector.h>
#include <vespa/searchlib/common/resultset.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/arraysize.h>
using namespace search;
diff --git a/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp b/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp
index 76efb2ec788..c17d78b25f3 100644
--- a/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp
+++ b/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/size_literals.h>
#include <vespa/searchlib/bitcompression/compression.h>
#include <vespa/searchlib/bitcompression/countcompression.h>
diff --git a/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp b/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp
index 62fee24f972..d2b07c6c552 100644
--- a/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp
+++ b/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp
@@ -14,7 +14,7 @@
#include <vespa/searchcommon/common/undefinedvalues.h>
#include <vespa/searchlib/test/make_attribute_map_lookup_node.h>
#include <vespa/vespalib/test/insertion_operators.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("attribute_node_test");
diff --git a/searchlib/src/tests/fef/featureoverride/featureoverride_test.cpp b/searchlib/src/tests/fef/featureoverride/featureoverride_test.cpp
index 5b3e3c356ac..f7c6b9fd7ed 100644
--- a/searchlib/src/tests/fef/featureoverride/featureoverride_test.cpp
+++ b/searchlib/src/tests/fef/featureoverride/featureoverride_test.cpp
@@ -1,5 +1,5 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/fef/fef.h>
#include <vespa/searchlib/fef/test/indexenvironment.h>
diff --git a/searchlib/src/tests/fef/fef_test.cpp b/searchlib/src/tests/fef/fef_test.cpp
index 0f2de1665e8..37089cfa5ea 100644
--- a/searchlib/src/tests/fef/fef_test.cpp
+++ b/searchlib/src/tests/fef/fef_test.cpp
@@ -1,5 +1,5 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/fef/fef.h>
#include <vespa/searchlib/fef/objectstore.h>
diff --git a/searchlib/src/tests/fileheadertk/fileheadertk_test.cpp b/searchlib/src/tests/fileheadertk/fileheadertk_test.cpp
index 7200566d735..cb1dcc6fb8b 100644
--- a/searchlib/src/tests/fileheadertk/fileheadertk_test.cpp
+++ b/searchlib/src/tests/fileheadertk/fileheadertk_test.cpp
@@ -1,7 +1,7 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/searchlib/util/fileheadertk.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/fastos/file.h>
#include <vespa/log/log.h>
diff --git a/searchlib/src/tests/grouping/grouping_test.cpp b/searchlib/src/tests/grouping/grouping_test.cpp
index d28ab1d3d66..0caebab6607 100644
--- a/searchlib/src/tests/grouping/grouping_test.cpp
+++ b/searchlib/src/tests/grouping/grouping_test.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
#include <vespa/searchlib/attribute/extendableattributes.h>
diff --git a/searchlib/src/tests/grouping/hyperloglog_test.cpp b/searchlib/src/tests/grouping/hyperloglog_test.cpp
index 61d81b76b08..281bad55735 100644
--- a/searchlib/src/tests/grouping/hyperloglog_test.cpp
+++ b/searchlib/src/tests/grouping/hyperloglog_test.cpp
@@ -7,7 +7,7 @@ LOG_SETUP("hyperloglog_test");
#include <vespa/searchlib/grouping/hyperloglog.h>
#include <vespa/vespalib/objects/nboserializer.h>
#include <vespa/vespalib/objects/nbostream.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
using vespalib::NBOSerializer;
using vespalib::nbostream;
diff --git a/searchlib/src/tests/grouping/sketch_test.cpp b/searchlib/src/tests/grouping/sketch_test.cpp
index e75e47266da..ae1052e9f59 100644
--- a/searchlib/src/tests/grouping/sketch_test.cpp
+++ b/searchlib/src/tests/grouping/sketch_test.cpp
@@ -4,7 +4,7 @@
#include <vespa/searchlib/grouping/sketch.h>
#include <vespa/vespalib/objects/nboserializer.h>
#include <vespa/vespalib/objects/nbostream.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/log/log.h>
diff --git a/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp b/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp
index 0c201da48d9..e65c5d812a4 100644
--- a/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp
+++ b/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
#include <vespa/searchlib/attribute/extendableattributes.h>
@@ -133,27 +133,18 @@ AggregationContext::AggregationContext()
AggregationContext::~AggregationContext() = default;
//-----------------------------------------------------------------------------
-class Test : public TestApp
+class CheckAttributeReferences : public vespalib::ObjectOperation, public vespalib::ObjectPredicate
{
public:
+ CheckAttributeReferences() : _numrefs(0) { }
+ int _numrefs;
private:
- bool testAggregation(AggregationContext &ctx, const Grouping &request, bool useEngine);
- void benchmarkIntegerSum(bool useEngine, size_t numDocs, size_t numQueries, int64_t maxGroups);
- void benchmarkIntegerCount(bool useEngine, size_t numDocs, size_t numQueries, int64_t maxGroups);
- class CheckAttributeReferences : public vespalib::ObjectOperation, public vespalib::ObjectPredicate
- {
- public:
- CheckAttributeReferences() : _numrefs(0) { }
- int _numrefs;
- private:
- void execute(vespalib::Identifiable &obj) override {
- if (static_cast<AttributeNode &>(obj).getAttribute() != nullptr) {
- _numrefs++;
- }
+ void execute(vespalib::Identifiable &obj) override {
+ if (static_cast<AttributeNode &>(obj).getAttribute() != nullptr) {
+ _numrefs++;
}
- virtual bool check(const vespalib::Identifiable &obj) const override { return obj.inherits(AttributeNode::classId); }
- };
- int Main() override;
+ }
+ virtual bool check(const vespalib::Identifiable &obj) const override { return obj.inherits(AttributeNode::classId); }
};
//-----------------------------------------------------------------------------
@@ -162,9 +153,7 @@ private:
* Run the given grouping request and verify that the resulting group
* tree matches the expected value.
**/
-bool
-Test::testAggregation(AggregationContext &ctx, const Grouping &request, bool useEngine)
-{
+bool testAggregation(AggregationContext &ctx, const Grouping &request, bool useEngine) {
Grouping tmp = request; // create local copy
ctx.setup(tmp);
if (useEngine) {
@@ -183,9 +172,7 @@ Test::testAggregation(AggregationContext &ctx, const Grouping &request, bool use
#define MU std::make_unique
-void
-Test::benchmarkIntegerSum(bool useEngine, size_t numDocs, size_t numQueries, int64_t maxGroups)
-{
+void benchmarkIntegerSum(bool useEngine, size_t numDocs, size_t numQueries, int64_t maxGroups) {
IntAttrBuilder attrB("attr0");
for (size_t i=0; i < numDocs; i++) {
attrB.add(i);
@@ -212,9 +199,7 @@ Test::benchmarkIntegerSum(bool useEngine, size_t numDocs, size_t numQueries, int
}
}
-void
-Test::benchmarkIntegerCount(bool useEngine, size_t numDocs, size_t numQueries, int64_t maxGroups)
-{
+void benchmarkIntegerCount(bool useEngine, size_t numDocs, size_t numQueries, int64_t maxGroups) {
IntAttrBuilder attrB("attr0");
for (size_t i=0; i < numDocs; i++) {
attrB.add(i);
@@ -241,34 +226,31 @@ Test::benchmarkIntegerCount(bool useEngine, size_t numDocs, size_t numQueries, i
}
}
-int
-Test::Main()
-{
+TEST_MAIN() {
size_t numDocs = 1000000;
size_t numQueries = 1000;
int64_t maxGroups = -1;
bool useEngine = true;
vespalib::string idType = "int";
vespalib::string aggrType = "sum";
- if (_argc > 1) {
- useEngine = (strcmp(_argv[1], "tree") != 0);
+ if (argc > 1) {
+ useEngine = (strcmp(argv[1], "tree") != 0);
}
- if (_argc > 2) {
- idType = _argv[2];
+ if (argc > 2) {
+ idType = argv[2];
}
- if (_argc > 3) {
- aggrType = _argv[3];
+ if (argc > 3) {
+ aggrType = argv[3];
}
- if (_argc > 4) {
- numDocs = strtol(_argv[4], nullptr, 0);
+ if (argc > 4) {
+ numDocs = strtol(argv[4], nullptr, 0);
}
- if (_argc > 5) {
- numQueries = strtol(_argv[5], nullptr, 0);
+ if (argc > 5) {
+ numQueries = strtol(argv[5], nullptr, 0);
}
- if (_argc > 6) {
- maxGroups = strtol(_argv[6], nullptr, 0);
+ if (argc > 6) {
+ maxGroups = strtol(argv[6], nullptr, 0);
}
- TEST_INIT("grouping_benchmark");
LOG(info, "sizeof(Group) = %ld", sizeof(Group));
LOG(info, "sizeof(ResultNode::CP) = %ld", sizeof(ResultNode::CP));
LOG(info, "sizeof(RawRank) = %ld", sizeof(RawRank));
@@ -290,7 +272,4 @@ Test::Main()
}
LOG(info, "rusage = {\n%s\n}", vespalib::RUsage::createSelf(start).toString().c_str());
ASSERT_EQUAL(0, kill(0, SIGPROF));
- TEST_DONE();
}
-
-TEST_APPHOOK(Test);
diff --git a/searchlib/src/tests/groupingengine/groupingengine_test.cpp b/searchlib/src/tests/groupingengine/groupingengine_test.cpp
index e00d2dcdd46..140304e0da9 100644
--- a/searchlib/src/tests/groupingengine/groupingengine_test.cpp
+++ b/searchlib/src/tests/groupingengine/groupingengine_test.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
#include <vespa/searchlib/attribute/extendableattributes.h>
@@ -131,69 +131,37 @@ AggregationContext::~AggregationContext() {}
//-----------------------------------------------------------------------------
-class Test : public TestApp
+class CheckAttributeReferences : public vespalib::ObjectOperation, public vespalib::ObjectPredicate
{
public:
- bool testAggregation(AggregationContext &ctx,
- const Grouping &request,
- const Group &expect);
- bool testMerge(const Grouping &a, const Grouping &b,
- const Group &expect);
- bool testMerge(const Grouping &a, const Grouping &b, const Grouping &c,
- const Group &expect);
- bool testPrune(const Grouping &a, const Grouping &b,
- const Group &expect);
- bool testPartialMerge(const Grouping &a, const Grouping &b,
- const Group &expect);
- void testAggregationSimple();
- void testAggregationLevels();
- void testAggregationMaxGroups();
- void testAggregationGroupOrder();
- void testAggregationGroupRank();
- void testAggregationGroupCapping();
- void testMergeSimpleSum();
- void testMergeLevels();
- void testMergeGroups();
- void testMergeTrees();
- void testPruneSimple();
- void testPruneComplex();
- void testPartialMerging();
- void testCount();
- void testTopN();
- void testFS4HitCollection();
- bool checkBucket(const NumericResultNode &width, const NumericResultNode &value, const BucketResultNode &bucket);
- bool checkHits(const Grouping &g, uint32_t first, uint32_t last, uint32_t cnt);
- void testFixedWidthBuckets();
- void testThatNanIsConverted();
- void testNanSorting();
- void testGroupingEngineFromRequest();
- int Main() override;
+ CheckAttributeReferences() : _numrefs(0) { }
+ int _numrefs;
private:
- bool verifyEqual(const Group & a, const Group & b);
- void testAggregationSimpleSum(AggregationContext & ctx, const AggregationResult & aggr, const ResultNode & ir, const ResultNode & fr, const ResultNode & sr);
- class CheckAttributeReferences : public vespalib::ObjectOperation, public vespalib::ObjectPredicate
- {
- public:
- CheckAttributeReferences() : _numrefs(0) { }
- int _numrefs;
- private:
- virtual void execute(vespalib::Identifiable &obj) override {
- if (static_cast<AttributeNode &>(obj).getAttribute() != NULL) {
- _numrefs++;
- }
+ virtual void execute(vespalib::Identifiable &obj) override {
+ if (static_cast<AttributeNode &>(obj).getAttribute() != NULL) {
+ _numrefs++;
}
- virtual bool check(const vespalib::Identifiable &obj) const override { return obj.inherits(AttributeNode::classId); }
- };
+ }
+ virtual bool check(const vespalib::Identifiable &obj) const override { return obj.inherits(AttributeNode::classId); }
};
//-----------------------------------------------------------------------------
+bool verifyEqual(const Group & a, const Group & b)
+{
+ bool ok = EXPECT_EQUAL(a.asString(), b.asString());
+ if (!ok) {
+ std::cerr << a.asString() << std::endl << b.asString() << std::endl;
+ }
+ return ok;
+}
+
/**
* Run the given grouping request and verify that the resulting group
* tree matches the expected value.
**/
bool
-Test::testAggregation(AggregationContext &ctx,
+testAggregation(AggregationContext &ctx,
const Grouping &request,
const Group &expect)
{
@@ -210,21 +178,12 @@ Test::testAggregation(AggregationContext &ctx,
return verifyEqual(*result, expect);
}
-bool Test::verifyEqual(const Group & a, const Group & b)
-{
- bool ok = EXPECT_EQUAL(a.asString(), b.asString());
- if (!ok) {
- std::cerr << a.asString() << std::endl << b.asString() << std::endl;
- }
- return ok;
-}
-
/**
* Merge the given grouping requests and verify that the resulting
* group tree matches the expected value.
**/
bool
-Test::testMerge(const Grouping &a, const Grouping &b,
+testMerge(const Grouping &a, const Grouping &b,
const Group &expect)
{
Grouping tmp = a; // create local copy
@@ -249,7 +208,7 @@ Test::testMerge(const Grouping &a, const Grouping &b,
* group tree matches the expected value.
**/
bool
-Test::testPrune(const Grouping &a, const Grouping &b,
+testPrune(const Grouping &a, const Grouping &b,
const Group &expect)
{
Grouping tmp = a; // create local copy
@@ -266,7 +225,7 @@ Test::testPrune(const Grouping &a, const Grouping &b,
* partial request is correct.
**/
bool
-Test::testPartialMerge(const Grouping &a, const Grouping &b,
+testPartialMerge(const Grouping &a, const Grouping &b,
const Group &expect)
{
Grouping tmp = a; // create local copy
@@ -283,7 +242,7 @@ Test::testPartialMerge(const Grouping &a, const Grouping &b,
* group tree matches the expected value.
**/
bool
-Test::testMerge(const Grouping &a, const Grouping &b, const Grouping &c,
+testMerge(const Grouping &a, const Grouping &b, const Grouping &c,
const Group &expect)
{
Grouping tmp = a; // create local copy
@@ -298,28 +257,9 @@ Test::testMerge(const Grouping &a, const Grouping &b, const Grouping &c,
//-----------------------------------------------------------------------------
-/**
- * Test collecting the sum of the values from a single attribute
- * vector directly into the root node. Consider this a smoke test.
- **/
-void
-Test::testAggregationSimple()
-{
- AggregationContext ctx;
- ctx.result().add(0).add(1).add(2);
- ctx.add(IntAttrBuilder("int").add(3).add(7).add(15).sp());
- ctx.add(FloatAttrBuilder("float").add(3).add(7).add(15).sp());
- ctx.add(StringAttrBuilder("string").add("3").add("7").add("15").sp());
-
- char strsum[3] = {(char)-101, '5', 0};
- testAggregationSimpleSum(ctx, SumAggregationResult(), Int64ResultNode(25), FloatResultNode(25), StringResultNode(strsum));
- testAggregationSimpleSum(ctx, MinAggregationResult(), Int64ResultNode(3), FloatResultNode(3), StringResultNode("15"));
- testAggregationSimpleSum(ctx, MaxAggregationResult(), Int64ResultNode(15), FloatResultNode(15), StringResultNode("7"));
-}
-
#define MU std::make_unique
-void Test::testAggregationSimpleSum(AggregationContext & ctx, const AggregationResult & aggr, const ResultNode & ir, const ResultNode & fr, const ResultNode & sr)
+void testAggregationSimpleSum(AggregationContext & ctx, const AggregationResult & aggr, const ResultNode & ir, const ResultNode & fr, const ResultNode & sr)
{
ExpressionNode::CP clone(aggr);
Grouping request;
@@ -337,6 +277,25 @@ void Test::testAggregationSimpleSum(AggregationContext & ctx, const AggregationR
EXPECT_TRUE(testAggregation(ctx, request, expect));
}
+/**
+ * Test collecting the sum of the values from a single attribute
+ * vector directly into the root node. Consider this a smoke test.
+ **/
+void
+testAggregationSimple()
+{
+ AggregationContext ctx;
+ ctx.result().add(0).add(1).add(2);
+ ctx.add(IntAttrBuilder("int").add(3).add(7).add(15).sp());
+ ctx.add(FloatAttrBuilder("float").add(3).add(7).add(15).sp());
+ ctx.add(StringAttrBuilder("string").add("3").add("7").add("15").sp());
+
+ char strsum[3] = {(char)-101, '5', 0};
+ testAggregationSimpleSum(ctx, SumAggregationResult(), Int64ResultNode(25), FloatResultNode(25), StringResultNode(strsum));
+ testAggregationSimpleSum(ctx, MinAggregationResult(), Int64ResultNode(3), FloatResultNode(3), StringResultNode("15"));
+ testAggregationSimpleSum(ctx, MaxAggregationResult(), Int64ResultNode(15), FloatResultNode(15), StringResultNode("7"));
+}
+
GroupingLevel
createGL(ExpressionNode::UP expr, ExpressionNode::UP result) {
GroupingLevel l;
@@ -374,7 +333,7 @@ createGL(size_t maxGroups, ExpressionNode::UP expr, ExpressionNode::UP result) {
* lastLevel parameters.
**/
void
-Test::testAggregationLevels()
+testAggregationLevels()
{
AggregationContext ctx;
ctx.add(IntAttrBuilder("attr0").add(10).add(10).sp());
@@ -496,7 +455,7 @@ Test::testAggregationLevels()
* indicated by the maxgroups parameter.
**/
void
-Test::testAggregationMaxGroups()
+testAggregationMaxGroups()
{
AggregationContext ctx;
ctx.add(IntAttrBuilder("attr").add(5).add(10).add(15).sp());
@@ -547,7 +506,7 @@ Test::testAggregationMaxGroups()
* Verify that groups are sorted by group id
**/
void
-Test::testAggregationGroupOrder()
+testAggregationGroupOrder()
{
AggregationContext ctx;
ctx.add(IntAttrBuilder("attr").add(10).add(25).add(35).add(5).add(20).add(15).add(30).sp());
@@ -574,7 +533,7 @@ Test::testAggregationGroupOrder()
* Verify that groups are tagged with the appropriate rank value.
**/
void
-Test::testAggregationGroupRank()
+testAggregationGroupRank()
{
AggregationContext ctx;
ctx.add(IntAttrBuilder("attr")
@@ -624,7 +583,7 @@ createNumAggr(NumericResultNode::UP r, ExpressionNode::UP e) {
}
void
-Test::testAggregationGroupCapping()
+testAggregationGroupCapping()
{
AggregationContext ctx;
ctx.add(IntAttrBuilder("attr")
@@ -748,7 +707,7 @@ Test::testAggregationGroupCapping()
* smoke test.
**/
void
-Test::testMergeSimpleSum()
+testMergeSimpleSum()
{
Grouping a = Grouping()
.setRoot(Group()
@@ -777,7 +736,7 @@ Test::testMergeSimpleSum()
* Verify that frozen levels are not touched during merge.
**/
void
-Test::testMergeLevels()
+testMergeLevels()
{
Grouping request = Grouping()
.addLevel(createGL(MU<AttributeNode>("c1"), MU<AttributeNode>("s1")))
@@ -957,7 +916,7 @@ Test::testMergeLevels()
* and that they are sorted by group id.
**/
void
-Test::testMergeGroups()
+testMergeGroups()
{
Grouping request = Grouping().addLevel(createGL(MU<AttributeNode>("attr")));
@@ -1018,7 +977,7 @@ Test::testMergeGroups()
* end result is as expected.
**/
void
-Test::testMergeTrees()
+testMergeTrees()
{
Grouping request;
request.addLevel(createGL(3, MU<AttributeNode>("c1"), MU<AttributeNode>("s1")))
@@ -1283,7 +1242,7 @@ Test::testMergeTrees()
}
void
-Test::testPruneComplex()
+testPruneComplex()
{
{ // First level
Group baseTree = Group()
@@ -1423,7 +1382,7 @@ Test::testPruneComplex()
* results.
**/
void
-Test::testPartialMerging()
+testPartialMerging()
{
Grouping baseRequest;
baseRequest.addLevel(createGL(MU<AttributeNode>("c1"), MU<AttributeNode>("s1")))
@@ -1588,7 +1547,7 @@ Test::testPartialMerging()
* Test that pruning a simple grouping tree works.
**/
void
-Test::testPruneSimple()
+testPruneSimple()
{
{
Grouping request;
@@ -1614,7 +1573,7 @@ Test::testPruneSimple()
* that we init, calculate and ignore.
**/
void
-Test::testTopN()
+testTopN()
{
AggregationContext ctx;
ctx.result().add(0).add(1).add(2);
@@ -1655,7 +1614,7 @@ Test::testTopN()
* that we init, calculate and ignore.
**/
void
-Test::testCount()
+testCount()
{
AggregationContext ctx;
ctx.result().add(0).add(1).add(2);
@@ -1676,7 +1635,7 @@ Test::testCount()
//-----------------------------------------------------------------------------
bool
-Test::checkHits(const Grouping &g, uint32_t first, uint32_t last, uint32_t cnt)
+checkHits(const Grouping &g, uint32_t first, uint32_t last, uint32_t cnt)
{
CountFS4Hits pop;
Grouping tmp = g;
@@ -1685,7 +1644,7 @@ Test::checkHits(const Grouping &g, uint32_t first, uint32_t last, uint32_t cnt)
}
void
-Test::testFS4HitCollection()
+testFS4HitCollection()
{
{ // aggregation
AggregationContext ctx;
@@ -1801,7 +1760,7 @@ Test::testFS4HitCollection()
}
bool
-Test::checkBucket(const NumericResultNode &width, const NumericResultNode &value, const BucketResultNode &bucket)
+checkBucket(const NumericResultNode &width, const NumericResultNode &value, const BucketResultNode &bucket)
{
AggregationContext ctx;
ctx.result().add(0);
@@ -1821,7 +1780,7 @@ Test::checkBucket(const NumericResultNode &width, const NumericResultNode &value
}
void
-Test::testFixedWidthBuckets()
+testFixedWidthBuckets()
{
using Int = Int64ResultNode;
using Float = FloatResultNode;
@@ -1879,7 +1838,7 @@ Test::testFixedWidthBuckets()
void
-Test::testNanSorting()
+testNanSorting()
{
// Attempt at reproducing issue with segfault when setting NaN value. Not
// successful yet, so no point in running test.
@@ -1913,7 +1872,7 @@ Test::testNanSorting()
}
void
-Test::testThatNanIsConverted()
+testThatNanIsConverted()
{
Group g;
double myNan = std::sqrt(-1);
@@ -1923,7 +1882,7 @@ Test::testThatNanIsConverted()
}
void
-Test::testGroupingEngineFromRequest()
+testGroupingEngineFromRequest()
{
AggregationContext ctx;
ctx.add(IntAttrBuilder("attr0").add(10).add(10).sp());
@@ -1943,19 +1902,8 @@ Test::testGroupingEngineFromRequest()
//-----------------------------------------------------------------------------
-struct RunDiff { ~RunDiff() {
- [[maybe_unused]] int system_result = system("diff -u lhs.out rhs.out > diff.txt");
-}};
-
-//-----------------------------------------------------------------------------
-
-int
-Test::Main()
-{
- RunDiff runDiff;
- (void) runDiff;
+TEST_MAIN() {
TEST_DEBUG("lhs.out", "rhs.out");
- TEST_INIT("groupingengine_test");
testGroupingEngineFromRequest();
testAggregationSimple();
testAggregationLevels();
@@ -1978,7 +1926,6 @@ Test::Main()
testTopN();
testThatNanIsConverted();
testNanSorting();
- TEST_DONE();
+ TEST_DEBUG_STOP();
+ [[maybe_unused]] int system_result = system("diff -u lhs.out rhs.out > diff.txt");
}
-
-TEST_APPHOOK(Test);
diff --git a/searchlib/src/tests/predicate/document_features_store_test.cpp b/searchlib/src/tests/predicate/document_features_store_test.cpp
index 3d479a6d39a..cc090a953b5 100644
--- a/searchlib/src/tests/predicate/document_features_store_test.cpp
+++ b/searchlib/src/tests/predicate/document_features_store_test.cpp
@@ -7,7 +7,7 @@
#include <vespa/searchlib/predicate/predicate_index.h>
#include <vespa/searchlib/predicate/predicate_tree_annotator.h>
#include <vespa/searchlib/predicate/predicate_hash.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <string>
#include <vespa/log/log.h>
diff --git a/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp
index 228b0eb242d..91e9fc0f9a4 100644
--- a/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp
@@ -7,7 +7,7 @@
#include <vespa/vespalib/btree/btreeroot.hpp>
#include <vespa/vespalib/btree/btreeiterator.hpp>
#include <vespa/vespalib/btree/btreestore.hpp>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("predicate_bounds_posting_list_test");
diff --git a/searchlib/src/tests/predicate/predicate_index_test.cpp b/searchlib/src/tests/predicate/predicate_index_test.cpp
index 461fa46d4da..120862a1477 100644
--- a/searchlib/src/tests/predicate/predicate_index_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_index_test.cpp
@@ -5,7 +5,7 @@
#include <vespa/searchlib/predicate/simple_index.hpp>
#include <vespa/searchlib/predicate/predicate_tree_annotator.h>
#include <vespa/searchlib/util/data_buffer_writer.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/attribute/predicate_attribute.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/vespalib/btree/btreeroot.hpp>
diff --git a/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp
index ab49e28bb96..3977933dbc3 100644
--- a/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp
@@ -7,7 +7,7 @@
#include <vespa/vespalib/btree/btreeroot.hpp>
#include <vespa/vespalib/btree/btreeiterator.hpp>
#include <vespa/vespalib/btree/btreestore.hpp>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("predicate_interval_posting_list_test");
diff --git a/searchlib/src/tests/predicate/predicate_interval_store_test.cpp b/searchlib/src/tests/predicate/predicate_interval_store_test.cpp
index 819563f64b8..9c2847bc8cf 100644
--- a/searchlib/src/tests/predicate/predicate_interval_store_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_interval_store_test.cpp
@@ -7,7 +7,7 @@ LOG_SETUP("predicate_interval_store_test");
#include <vespa/searchlib/predicate/predicate_interval_store.h>
#include <vespa/searchlib/predicate/predicate_index.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vector>
using namespace search;
diff --git a/searchlib/src/tests/predicate/predicate_range_term_expander_test.cpp b/searchlib/src/tests/predicate/predicate_range_term_expander_test.cpp
index 162829be5a3..bec1cd9f24a 100644
--- a/searchlib/src/tests/predicate/predicate_range_term_expander_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_range_term_expander_test.cpp
@@ -6,7 +6,7 @@ LOG_SETUP("predicate_range_term_expander_test");
#include <vespa/searchlib/predicate/predicate_range_term_expander.h>
#include <vespa/vespalib/btree/btreestore.hpp>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
using search::predicate::PredicateRangeTermExpander;
using std::vector;
diff --git a/searchlib/src/tests/predicate/predicate_ref_cache_test.cpp b/searchlib/src/tests/predicate/predicate_ref_cache_test.cpp
index c8327033a8c..692482b8933 100644
--- a/searchlib/src/tests/predicate/predicate_ref_cache_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_ref_cache_test.cpp
@@ -5,7 +5,7 @@
LOG_SETUP("predicate_ref_cache_test");
#include <vespa/searchlib/predicate/predicate_ref_cache.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vector>
using namespace search;
diff --git a/searchlib/src/tests/predicate/predicate_tree_analyzer_test.cpp b/searchlib/src/tests/predicate/predicate_tree_analyzer_test.cpp
index c766aa70bad..854abcd6fda 100644
--- a/searchlib/src/tests/predicate/predicate_tree_analyzer_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_tree_analyzer_test.cpp
@@ -7,7 +7,7 @@ LOG_SETUP("PredicateTreeAnalyzer_test");
#include <vespa/document/predicate/predicate.h>
#include <vespa/document/predicate/predicate_slime_builder.h>
#include <vespa/searchlib/predicate/predicate_tree_analyzer.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
using document::PredicateSlimeBuilder;
using namespace search;
diff --git a/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp b/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp
index 82629527b4d..fa586153f19 100644
--- a/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp
@@ -7,7 +7,7 @@
#include <vespa/searchlib/predicate/predicate_tree_annotator.h>
#include <vespa/searchlib/predicate/predicate_hash.h>
#include <vespa/vespalib/data/slime/slime.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <sstream>
#include <vespa/log/log.h>
diff --git a/searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp
index 9e9ac45f1ae..83d29102a7b 100644
--- a/searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp
@@ -4,7 +4,7 @@
#include <vespa/searchlib/predicate/predicate_zero_constraint_posting_list.h>
#include <vespa/searchlib/predicate/predicate_index.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("predicate_zero_constraint_posting_list_test");
diff --git a/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp
index 0e99379568d..a7011ec51d2 100644
--- a/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp
@@ -6,7 +6,7 @@
#include <vespa/vespalib/btree/btreeroot.hpp>
#include <vespa/vespalib/btree/btreeiterator.hpp>
#include <vespa/vespalib/btree/btreestore.hpp>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("predicate_zstar_compressed_posting_list_test");
diff --git a/searchlib/src/tests/predicate/simple_index_test.cpp b/searchlib/src/tests/predicate/simple_index_test.cpp
index 9b99ff8e809..a9e5e7c9065 100644
--- a/searchlib/src/tests/predicate/simple_index_test.cpp
+++ b/searchlib/src/tests/predicate/simple_index_test.cpp
@@ -5,7 +5,7 @@
#include <vespa/searchlib/predicate/simple_index_saver.hpp>
#include <vespa/searchlib/predicate/nbo_write.h>
#include <vespa/searchlib/util/data_buffer_writer.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/attribute/predicate_attribute.h>
#include <vespa/vespalib/btree/btree.hpp>
#include <vespa/vespalib/btree/btreeroot.hpp>
diff --git a/searchlib/src/tests/predicate/tree_crumbs_test.cpp b/searchlib/src/tests/predicate/tree_crumbs_test.cpp
index f5ff488fdc0..5c5775e5a5b 100644
--- a/searchlib/src/tests/predicate/tree_crumbs_test.cpp
+++ b/searchlib/src/tests/predicate/tree_crumbs_test.cpp
@@ -5,7 +5,7 @@
LOG_SETUP("TreeCrumbs_test");
#include <vespa/searchlib/predicate/tree_crumbs.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
using namespace search::predicate;
diff --git a/searchlib/src/tests/query/customtypevisitor_test.cpp b/searchlib/src/tests/query/customtypevisitor_test.cpp
index fb89f2ef061..702bed6e50e 100644
--- a/searchlib/src/tests/query/customtypevisitor_test.cpp
+++ b/searchlib/src/tests/query/customtypevisitor_test.cpp
@@ -5,7 +5,7 @@
#include <vespa/searchlib/query/tree/intermediatenodes.h>
#include <vespa/searchlib/query/tree/string_term_vector.h>
#include <vespa/searchlib/query/tree/termnodes.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("customtypevisitor_test");
diff --git a/searchlib/src/tests/query/query_visitor_test.cpp b/searchlib/src/tests/query/query_visitor_test.cpp
index bfce382b684..e1265680f7b 100644
--- a/searchlib/src/tests/query/query_visitor_test.cpp
+++ b/searchlib/src/tests/query/query_visitor_test.cpp
@@ -7,7 +7,7 @@
#include <vespa/searchlib/query/tree/simplequery.h>
#include <vespa/searchlib/query/tree/string_term_vector.h>
#include <vespa/searchlib/query/tree/termnodes.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("query_visitor_test");
diff --git a/searchlib/src/tests/query/stackdumpquerycreator_test.cpp b/searchlib/src/tests/query/stackdumpquerycreator_test.cpp
index 29ef179385d..4ae94c17804 100644
--- a/searchlib/src/tests/query/stackdumpquerycreator_test.cpp
+++ b/searchlib/src/tests/query/stackdumpquerycreator_test.cpp
@@ -5,7 +5,7 @@
#include <vespa/searchlib/parsequery/stackdumpiterator.h>
#include <vespa/searchlib/query/tree/simplequery.h>
#include <vespa/searchlib/util/rawbuf.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("stackdumpquerycreator_test");
diff --git a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp
index f7745da174c..77d0099afdb 100644
--- a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp
+++ b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "mysearch.h"
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/queryeval/flow.h>
#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/queryeval/intermediate_blueprints.h>
diff --git a/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp b/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp
index 490f221d1d8..a8707bb6f7e 100644
--- a/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp
+++ b/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp
@@ -1,7 +1,7 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "mysearch.h"
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/queryeval/isourceselector.h>
#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/queryeval/flow.h>
diff --git a/searchlib/src/tests/queryeval/getnodeweight/getnodeweight_test.cpp b/searchlib/src/tests/queryeval/getnodeweight/getnodeweight_test.cpp
index d9b7d5b3192..fda2e84402a 100644
--- a/searchlib/src/tests/queryeval/getnodeweight/getnodeweight_test.cpp
+++ b/searchlib/src/tests/queryeval/getnodeweight/getnodeweight_test.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/query/tree/simplequery.h>
#include <vespa/searchlib/queryeval/get_weight_from_node.h>
diff --git a/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp b/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp
index 95e80cd08b8..ddb9cab18ab 100644
--- a/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp
+++ b/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/queryeval/multibitvectoriterator.h>
#include <vespa/searchlib/queryeval/emptysearch.h>
#include <vespa/searchlib/common/bitvectoriterator.h>
@@ -17,15 +17,11 @@ using namespace search;
//-----------------------------------------------------------------------------
-class Test : public vespalib::TestApp
+struct Fixture
{
-public:
- ~Test() {}
void benchmark();
- int Main() override;
template <typename T>
void testSearch(bool strict);
-private:
void searchAndCompare(SearchIterator::UP s, uint32_t docIdLimit);
void setup();
std::vector< BitVector::UP > _bvs;
@@ -35,9 +31,22 @@ private:
bool _optimize;
vespalib::string _type;
std::vector<int> _fillLimits;
+
+ Fixture(int argc, char **argv) {
+ _type = argv[1];
+ _strict = vespalib::string(argv[2]) == vespalib::string("strict");
+ _optimize = vespalib::string(argv[3]) == vespalib::string("optimize");
+ _numSearch = strtoul(argv[4], NULL, 0);
+ _numDocs = strtoul(argv[5], NULL, 0);
+ for (int i(6); i < argc; i++) {
+ _fillLimits.push_back((RAND_MAX/100) * strtoul(argv[i], NULL, 0));
+ }
+ }
+ ~Fixture();
};
+Fixture::~Fixture() = default;
-void Test::setup()
+void Fixture::setup()
{
for(size_t i(0); i < _fillLimits.size(); i++) {
_bvs.push_back(BitVector::create(_numDocs));
@@ -76,7 +85,7 @@ seek(SearchIterator & s, uint32_t docIdLimit)
}
void
-Test::benchmark()
+Fixture::benchmark()
{
if (_type == "and") {
LOG(info, "Testing 'and'");
@@ -93,7 +102,7 @@ Test::benchmark()
template <typename T>
void
-Test::testSearch(bool strict)
+Fixture::testSearch(bool strict)
{
TermFieldMatchData tfmd;
MultiSearch::Children andd;
@@ -109,29 +118,15 @@ Test::testSearch(bool strict)
LOG(info, "Found %ld hits", h.size());
}
-int
-Test::Main()
-{
- TEST_INIT("multibitvectoriterator_benchmark");
- if (_argc < 6) {
- LOG(info, "%s <'and/or'> <'strict/no-strict'> <'optimize/no-optimize> <numsearch> <numdocs> <fill 1> [<fill N>]", _argv[0]);
- return -1;
- }
- _type = _argv[1];
- _strict = vespalib::string(_argv[2]) == vespalib::string("strict");
- _optimize = vespalib::string(_argv[3]) == vespalib::string("optimize");
- _numSearch = strtoul(_argv[4], NULL, 0);
- _numDocs = strtoul(_argv[5], NULL, 0);
- for (int i(6); i < _argc; i++) {
- _fillLimits.push_back((RAND_MAX/100) * strtoul(_argv[i], NULL, 0));
+TEST_MAIN() {
+ if (argc < 6) {
+ LOG(info, "%s <'and/or'> <'strict/no-strict'> <'optimize/no-optimize> <numsearch> <numdocs> <fill 1> [<fill N>]", argv[0]);
+ exit(1);
}
- LOG(info, "Start setup of '%s' isearch with %ld vectors with %d documents", _type.c_str(), _fillLimits.size(), _numDocs);
- setup();
+ Fixture fixture(argc, argv);
+ LOG(info, "Start setup of '%s' isearch with %ld vectors with %d documents", fixture._type.c_str(), fixture._fillLimits.size(), fixture._numDocs);
+ fixture.setup();
LOG(info, "Start benchmark");
- benchmark();
+ fixture.benchmark();
LOG(info, "Done benchmark");
- TEST_FLUSH();
- TEST_DONE();
}
-
-TEST_APPHOOK(Test);
diff --git a/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp b/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp
index ffa2905ce0e..1ae6cff447e 100644
--- a/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp
+++ b/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp
@@ -11,7 +11,7 @@
#include <vespa/searchlib/queryeval/field_spec.h>
#include <vespa/searchlib/queryeval/predicate_blueprint.h>
#include <vespa/searchlib/predicate/predicate_hash.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("predicate_blueprint_test");
diff --git a/searchlib/src/tests/queryeval/predicate/predicate_search_test.cpp b/searchlib/src/tests/queryeval/predicate/predicate_search_test.cpp
index a69b4c7a45d..b02df263f82 100644
--- a/searchlib/src/tests/queryeval/predicate/predicate_search_test.cpp
+++ b/searchlib/src/tests/queryeval/predicate/predicate_search_test.cpp
@@ -7,7 +7,7 @@ LOG_SETUP("predicate_search_test");
#include <vespa/searchlib/fef/termfieldmatchdata.h>
#include <vespa/searchlib/fef/termfieldmatchdataarray.h>
#include <vespa/searchlib/queryeval/predicate_search.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/arraysize.h>
using search::fef::TermFieldMatchData;
diff --git a/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp b/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp
index 3e779bdca14..184d21fcaae 100644
--- a/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp
+++ b/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp
@@ -10,7 +10,7 @@
#include <vespa/searchlib/query/tree/simplequery.h>
#include <vespa/searchlib/query/weight.h>
#include <vespa/vespalib/util/testclock.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("simple_phrase_test");
@@ -46,46 +46,6 @@ struct MyTerm : public search::queryeval::SimpleLeafBlueprint {
}
};
-class Test : public vespalib::TestApp {
- void requireThatIteratorFindsSimplePhrase(bool useBlueprint);
- void requireThatIteratorFindsLongPhrase(bool useBlueprint);
- void requireThatStrictIteratorFindsNextMatch(bool useBlueprint);
- void requireThatPhrasesAreUnpacked(bool useBlueprint, bool unpack_normal_features, bool unpack_interleaved_features);
- void requireThatTermsCanBeEvaluatedInPriorityOrder();
- void requireThatBlueprintExposesFieldWithEstimate();
- void requireThatBlueprintForcesPositionDataOnChildren();
-
-public:
- int Main() override;
-};
-
-int
-Test::Main()
-{
- TEST_INIT("phrasesearch_test");
-
- TEST_DO(requireThatIteratorFindsSimplePhrase(false));
- TEST_DO(requireThatIteratorFindsLongPhrase(false));
- TEST_DO(requireThatStrictIteratorFindsNextMatch(false));
- TEST_DO(requireThatPhrasesAreUnpacked(false, true, false));
- TEST_DO(requireThatPhrasesAreUnpacked(false, true, true));
- TEST_DO(requireThatPhrasesAreUnpacked(false, false, false));
- TEST_DO(requireThatPhrasesAreUnpacked(false, false, true));
- TEST_DO(requireThatTermsCanBeEvaluatedInPriorityOrder());
-
- TEST_DO(requireThatIteratorFindsSimplePhrase(true));
- TEST_DO(requireThatIteratorFindsLongPhrase(true));
- TEST_DO(requireThatStrictIteratorFindsNextMatch(true));
- TEST_DO(requireThatPhrasesAreUnpacked(true, true, false));
- TEST_DO(requireThatPhrasesAreUnpacked(true, true, true));
- TEST_DO(requireThatPhrasesAreUnpacked(true, false, false));
- TEST_DO(requireThatPhrasesAreUnpacked(true, false, true));
- TEST_DO(requireThatBlueprintExposesFieldWithEstimate());
- TEST_DO(requireThatBlueprintForcesPositionDataOnChildren());
-
- TEST_DONE();
-}
-
const string field = "field";
const uint32_t fieldId = 1;
const uint32_t doc_match = 42;
@@ -198,73 +158,85 @@ PhraseSearchTest::PhraseSearchTest(bool expiredDoom)
{}
PhraseSearchTest::~PhraseSearchTest() = default;
-void Test::requireThatIteratorFindsSimplePhrase(bool useBlueprint) {
- PhraseSearchTest test;
- test.addTerm("foo", 0).addTerm("bar", 1);
+TEST("requireThatIteratorFindsSimplePhrase") {
+ for (bool useBlueprint: {false, true}) {
+ PhraseSearchTest test;
+ test.addTerm("foo", 0).addTerm("bar", 1);
- test.fetchPostings(useBlueprint);
- unique_ptr<SearchIterator> search(test.createSearch(useBlueprint));
- EXPECT_TRUE(!search->seek(1u));
- EXPECT_TRUE(search->seek(doc_match));
- EXPECT_TRUE(!search->seek(doc_no_match));
+ test.fetchPostings(useBlueprint);
+ unique_ptr<SearchIterator> search(test.createSearch(useBlueprint));
+ EXPECT_TRUE(!search->seek(1u));
+ EXPECT_TRUE(search->seek(doc_match));
+ EXPECT_TRUE(!search->seek(doc_no_match));
+ }
}
-void Test::requireThatIteratorFindsLongPhrase(bool useBlueprint) {
- PhraseSearchTest test;
- test.addTerm("foo", 0).addTerm("bar", 0).addTerm("baz", 0)
- .addTerm("qux", 1);
-
- test.fetchPostings(useBlueprint);
- unique_ptr<SearchIterator> search(test.createSearch(useBlueprint));
- EXPECT_TRUE(!search->seek(1u));
- EXPECT_TRUE(search->seek(doc_match));
- EXPECT_TRUE(!search->seek(doc_no_match));
+TEST("requireThatIteratorFindsLongPhrase") {
+ for (bool useBlueprint: {false, true}) {
+ PhraseSearchTest test;
+ test.addTerm("foo", 0).addTerm("bar", 0).addTerm("baz", 0)
+ .addTerm("qux", 1);
+
+ test.fetchPostings(useBlueprint);
+ unique_ptr<SearchIterator> search(test.createSearch(useBlueprint));
+ EXPECT_TRUE(!search->seek(1u));
+ EXPECT_TRUE(search->seek(doc_match));
+ EXPECT_TRUE(!search->seek(doc_no_match));
+ }
}
-void Test::requireThatStrictIteratorFindsNextMatch(bool useBlueprint) {
- PhraseSearchTest test;
- test.setStrict(true);
- test.addTerm("foo", 0).addTerm("bar", 1);
-
- test.fetchPostings(useBlueprint);
- unique_ptr<SearchIterator> search(test.createSearch(useBlueprint));
- EXPECT_TRUE(!search->seek(1u));
- EXPECT_EQUAL(doc_match, search->getDocId());
- EXPECT_TRUE(!search->seek(doc_no_match));
- EXPECT_TRUE(search->isAtEnd());
+TEST("requireThatStrictIteratorFindsNextMatch") {
+ for (bool useBlueprint: {false, true}) {
+ PhraseSearchTest test;
+ test.setStrict(true);
+ test.addTerm("foo", 0).addTerm("bar", 1);
+
+ test.fetchPostings(useBlueprint);
+ unique_ptr<SearchIterator> search(test.createSearch(useBlueprint));
+ EXPECT_TRUE(!search->seek(1u));
+ EXPECT_EQUAL(doc_match, search->getDocId());
+ EXPECT_TRUE(!search->seek(doc_no_match));
+ EXPECT_TRUE(search->isAtEnd());
+ }
}
-void Test::requireThatPhrasesAreUnpacked(bool useBlueprint, bool unpack_normal_features, bool unpack_interleaved_features) {
- PhraseSearchTest test;
- test.addTerm("foo", FakeResult()
- .doc(doc_match).pos(1).pos(11).pos(21).field_length(30).num_occs(3));
- test.addTerm("bar", FakeResult()
- .doc(doc_match).pos(2).pos(16).pos(22).field_length(30).num_occs(3));
- test.writable_term_field_match_data().setNeedNormalFeatures(unpack_normal_features);
- test.writable_term_field_match_data().setNeedInterleavedFeatures(unpack_interleaved_features);
- test.fetchPostings(useBlueprint);
- unique_ptr<SearchIterator> search(test.createSearch(useBlueprint));
- EXPECT_TRUE(search->seek(doc_match));
- search->unpack(doc_match);
-
- EXPECT_EQUAL(doc_match, test.tmd().getDocId());
- if (unpack_normal_features) {
- EXPECT_EQUAL(2, std::distance(test.tmd().begin(), test.tmd().end()));
- EXPECT_EQUAL(1u, test.tmd().begin()->getPosition());
- EXPECT_EQUAL(21u, (test.tmd().begin() + 1)->getPosition());
- } else {
- EXPECT_EQUAL(0, std::distance(test.tmd().begin(), test.tmd().end()));
- }
- if (unpack_interleaved_features) {
- EXPECT_EQUAL(2u, test.tmd().getNumOccs());
- EXPECT_EQUAL(30u, test.tmd().getFieldLength());
- } else {
- EXPECT_EQUAL(0u, test.tmd().getNumOccs());
- EXPECT_EQUAL(0u, test.tmd().getFieldLength());
+TEST("requireThatPhrasesAreUnpacked") {
+ for (bool useBlueprint: {false, true}) {
+ for (bool unpack_normal_features: {false, true}) {
+ for (bool unpack_interleaved_features: {false, true}) {
+ PhraseSearchTest test;
+ test.addTerm("foo", FakeResult()
+ .doc(doc_match).pos(1).pos(11).pos(21).field_length(30).num_occs(3));
+ test.addTerm("bar", FakeResult()
+ .doc(doc_match).pos(2).pos(16).pos(22).field_length(30).num_occs(3));
+ test.writable_term_field_match_data().setNeedNormalFeatures(unpack_normal_features);
+ test.writable_term_field_match_data().setNeedInterleavedFeatures(unpack_interleaved_features);
+ test.fetchPostings(useBlueprint);
+ unique_ptr<SearchIterator> search(test.createSearch(useBlueprint));
+ EXPECT_TRUE(search->seek(doc_match));
+ search->unpack(doc_match);
+
+ EXPECT_EQUAL(doc_match, test.tmd().getDocId());
+ if (unpack_normal_features) {
+ EXPECT_EQUAL(2, std::distance(test.tmd().begin(), test.tmd().end()));
+ EXPECT_EQUAL(1u, test.tmd().begin()->getPosition());
+ EXPECT_EQUAL(21u, (test.tmd().begin() + 1)->getPosition());
+ } else {
+ EXPECT_EQUAL(0, std::distance(test.tmd().begin(), test.tmd().end()));
+ }
+ if (unpack_interleaved_features) {
+ EXPECT_EQUAL(2u, test.tmd().getNumOccs());
+ EXPECT_EQUAL(30u, test.tmd().getFieldLength());
+ } else {
+ EXPECT_EQUAL(0u, test.tmd().getNumOccs());
+ EXPECT_EQUAL(0u, test.tmd().getFieldLength());
+ }
+ }
+ }
}
}
-void Test::requireThatTermsCanBeEvaluatedInPriorityOrder() {
+TEST("requireThatTermsCanBeEvaluatedInPriorityOrder") {
vector<uint32_t> order;
order.push_back(2);
order.push_back(0);
@@ -280,9 +252,7 @@ void Test::requireThatTermsCanBeEvaluatedInPriorityOrder() {
EXPECT_TRUE(!search->seek(doc_no_match));
}
-void
-Test::requireThatBlueprintExposesFieldWithEstimate()
-{
+TEST("requireThatBlueprintExposesFieldWithEstimate") {
FieldSpec f("foo", 1, 1);
SimplePhraseBlueprint phrase(f, false);
ASSERT_TRUE(phrase.getState().numFields() == 1);
@@ -305,9 +275,7 @@ Test::requireThatBlueprintExposesFieldWithEstimate()
EXPECT_EQUAL(5u, phrase.getState().estimate().estHits);
}
-void
-Test::requireThatBlueprintForcesPositionDataOnChildren()
-{
+TEST("requireThatBlueprintForcesPositionDataOnChildren") {
FieldSpec f("foo", 1, 1, true);
SimplePhraseBlueprint phrase(f, false);
EXPECT_TRUE(f.isFilter());
@@ -316,4 +284,4 @@ Test::requireThatBlueprintForcesPositionDataOnChildren()
} // namespace
-TEST_APPHOOK(Test);
+TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchlib/src/tests/sort/sort_test.cpp b/searchlib/src/tests/sort/sort_test.cpp
index f6d24d2889c..f0047e6fe0e 100644
--- a/searchlib/src/tests/sort/sort_test.cpp
+++ b/searchlib/src/tests/sort/sort_test.cpp
@@ -1,5 +1,5 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/common/sort.h>
#include <vespa/searchlib/common/sortspec.h>
#include <vespa/searchlib/common/converters.h>
diff --git a/searchlib/src/tests/sort/sortbenchmark.cpp b/searchlib/src/tests/sort/sortbenchmark.cpp
index 3a93e359efc..2f18fcfff8c 100644
--- a/searchlib/src/tests/sort/sortbenchmark.cpp
+++ b/searchlib/src/tests/sort/sortbenchmark.cpp
@@ -1,5 +1,5 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/common/sort.h>
#include <vespa/vespalib/util/array.h>
#include <vespa/vespalib/util/buffer.h>
@@ -8,21 +8,15 @@
using vespalib::Array;
using vespalib::ConstBufferRef;
-class Test : public vespalib::TestApp
-{
-public:
+struct Test {
using V = std::vector<uint32_t>;
std::vector< std::vector<uint32_t> > _data;
- int Main() override;
void generateVectors(size_t numVectors, size_t values);
V merge();
void twoWayMerge();
V cat() const;
- Test();
- ~Test() override;
+ ~Test();
};
-
-Test::Test() = default;
Test::~Test() = default;
void
@@ -82,31 +76,27 @@ Test::cat() const
return c;
}
-TEST_APPHOOK(Test);
-
-int Test::Main()
-{
- TEST_INIT("sortbenchmark");
+TEST_MAIN() {
size_t numVectors(11);
size_t values(10000000);
vespalib::string type("radix");
- if (_argc > 1) {
- values = strtol(_argv[1], NULL, 0);
- if (_argc > 2) {
- numVectors = strtol(_argv[2], NULL, 0);
- if (_argc > 2) {
- type = _argv[3];
+ if (argc > 1) {
+ values = strtol(argv[1], NULL, 0);
+ if (argc > 2) {
+ numVectors = strtol(argv[2], NULL, 0);
+ if (argc > 2) {
+ type = argv[3];
}
}
}
-
+ Test test;
printf("Start with %ld vectors with %ld values and type '%s'(radix, qsort, merge)\n", numVectors, values, type.c_str());
- generateVectors(numVectors, values);
+ test.generateVectors(numVectors, values);
printf("Start cat\n");
- V v = cat();
+ auto v = test.cat();
printf("Cat %ld values\n", v.size());
if (type == "merge") {
- V m = merge();
+ auto m = test.merge();
printf("Merged %ld values\n", m.size());
} else if (type == "qsort") {
std::sort(v.begin(), v.end());
@@ -116,6 +106,4 @@ int Test::Main()
S(&v[0], v.size());
printf("sorted %ld value with radix::sort\n", v.size());
}
-
- TEST_DONE();
}
diff --git a/searchlib/src/tests/sortspec/multilevelsort_test.cpp b/searchlib/src/tests/sortspec/multilevelsort_test.cpp
index f3bf363645e..86e8a932510 100644
--- a/searchlib/src/tests/sortspec/multilevelsort_test.cpp
+++ b/searchlib/src/tests/sortspec/multilevelsort_test.cpp
@@ -8,7 +8,7 @@
#include <vespa/searchlib/attribute/attributemanager.h>
#include <vespa/searchlib/uca/ucaconverter.h>
#include <vespa/searchcommon/attribute/config.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <type_traits>
#include <cinttypes>
#include <vespa/log/log.h>
diff --git a/searchlib/src/tests/transactionlog/chunks_test.cpp b/searchlib/src/tests/transactionlog/chunks_test.cpp
index 76045786895..e057e853d0d 100644
--- a/searchlib/src/tests/transactionlog/chunks_test.cpp
+++ b/searchlib/src/tests/transactionlog/chunks_test.cpp
@@ -1,7 +1,7 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/searchlib/transactionlog/chunks.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <atomic>
#include <vespa/log/log.h>
diff --git a/searchlib/src/tests/transactionlog/translogclient_test.cpp b/searchlib/src/tests/transactionlog/translogclient_test.cpp
index 9ba9780f8ed..07f43e98cd3 100644
--- a/searchlib/src/tests/transactionlog/translogclient_test.cpp
+++ b/searchlib/src/tests/transactionlog/translogclient_test.cpp
@@ -2,7 +2,7 @@
#include <vespa/searchlib/transactionlog/translogclient.h>
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/searchlib/test/directory_handler.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/objects/identifiable.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/document/util/bytebuffer.h>
diff --git a/searchlib/src/tests/util/bufferwriter/bufferwriter_test.cpp b/searchlib/src/tests/util/bufferwriter/bufferwriter_test.cpp
index dcf4d15181b..d1ce5f09cfa 100644
--- a/searchlib/src/tests/util/bufferwriter/bufferwriter_test.cpp
+++ b/searchlib/src/tests/util/bufferwriter/bufferwriter_test.cpp
@@ -1,6 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/searchlib/util/bufferwriter.h>
#include <vespa/searchlib/util/drainingbufferwriter.h>
diff --git a/searchlib/src/tests/util/rawbuf_test.cpp b/searchlib/src/tests/util/rawbuf_test.cpp
index cee340481f8..5f8001b6af3 100644
--- a/searchlib/src/tests/util/rawbuf_test.cpp
+++ b/searchlib/src/tests/util/rawbuf_test.cpp
@@ -2,7 +2,7 @@
#include <vespa/searchlib/util/rawbuf.h>
#include <vespa/vespalib/stllike/string.h>
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/log/log.h>
LOG_SETUP("rawbuf_test");