ProteoWizard
pwiz
utility
misc
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
23
#include "
pwiz/utility/misc/Export.hpp
"
24
#include "
pwiz/data/msdata/Reader.hpp
"
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
35
struct
PWIZ_API_DECL
TestPathPredicate
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
44
struct
PWIZ_API_DECL
ReaderTestConfig
:
public
pwiz::msdata::Reader::Config
45
{
46
ReaderTestConfig
() : peakPicking(false) {}
47
std::string
resultFilename
(
const
std::string& baseFilename)
const
;
48
bool
peakPicking
;
49
boost::optional<std::pair<int, int>>
indexRange
;
50
};
51
52
/// A common test harness for vendor readers;
53
PWIZ_API_DECL
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
Export.hpp
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition
Export.hpp:32
testReader
void testReader()
Definition
MSDataFileTest.cpp:326
pwiz::msdata::Reader
interface for file readers
Definition
Reader.hpp:39
Reader.hpp
pwiz
Definition
ChromatogramList_Filter.hpp:36
pwiz::msdata::Reader::Config
Reader configuration.
Definition
Reader.hpp:45
pwiz::util::ReaderTestConfig
Definition
VendorReaderTestHarness.hpp:45
pwiz::util::ReaderTestConfig::ReaderTestConfig
ReaderTestConfig()
Definition
VendorReaderTestHarness.hpp:46
pwiz::util::ReaderTestConfig::resultFilename
std::string resultFilename(const std::string &baseFilename) const
pwiz::util::ReaderTestConfig::indexRange
boost::optional< std::pair< int, int > > indexRange
Definition
VendorReaderTestHarness.hpp:49
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:36
pwiz::util::TestPathPredicate::~TestPathPredicate
virtual ~TestPathPredicate()
Definition
VendorReaderTestHarness.hpp:40
Generated by
1.9.8