ProteoWizard
VendorReaderTestHarness.hpp
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 //
5 // Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
6 //
7 // Copyright 2009 Vanderbilt University - Nashville, TN 37232
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 //
21 
22 
25 #include <boost/optional.hpp>
26 #include <string>
27 #include <vector>
28 
29 
30 namespace pwiz {
31 namespace util {
32 
33 
34 /// test implementations derive from this to define which paths should be tested
36 {
37  /// returns true iff the given rawpath is a real path to test/generate
38  virtual bool operator() (const std::string& rawpath) const = 0;
39 
40  virtual ~TestPathPredicate() {}
41 };
42 
43 
45 {
46  ReaderTestConfig() : peakPicking(false) {}
47  std::string resultFilename(const std::string& baseFilename) const;
49  boost::optional<std::pair<int, int>> indexRange;
50 };
51 
52 /// A common test harness for vendor readers;
54 int testReader(const pwiz::msdata::Reader& reader,
55  const std::vector<std::string>& args,
56  bool testAcceptOnly, bool requireUnicodeSupport,
57  const TestPathPredicate& isPathTestable,
58  const ReaderTestConfig& config = ReaderTestConfig());
59 
60 
61 } // namespace util
62 } // namespace pwiz
pwiz::msdata::Reader::Config
Reader configuration.
Definition: Reader.hpp:44
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::util::ReaderTestConfig
Definition: VendorReaderTestHarness.hpp:44
pwiz::msdata::Reader
interface for file readers
Definition: Reader.hpp:38
pwiz::util::TestPathPredicate::~TestPathPredicate
virtual ~TestPathPredicate()
Definition: VendorReaderTestHarness.hpp:40
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
Export.hpp
pwiz::util::ReaderTestConfig::peakPicking
bool peakPicking
Definition: VendorReaderTestHarness.hpp:48
pwiz::util::TestPathPredicate
test implementations derive from this to define which paths should be tested
Definition: VendorReaderTestHarness.hpp:35
Reader.hpp
pwiz::util::ReaderTestConfig::indexRange
boost::optional< std::pair< int, int > > indexRange
Definition: VendorReaderTestHarness.hpp:49
pwiz::util::ReaderTestConfig::ReaderTestConfig
ReaderTestConfig()
Definition: VendorReaderTestHarness.hpp:46
pwiz::util::testReader
PWIZ_API_DECL int testReader(const pwiz::msdata::Reader &reader, const std::vector< std::string > &args, bool testAcceptOnly, bool requireUnicodeSupport, const TestPathPredicate &isPathTestable, const ReaderTestConfig &config=ReaderTestConfig())
A common test harness for vendor readers;.