ProteoWizard
Reader_Bruker_Test.cpp
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 "Reader_Bruker.hpp"
28
30{
31 bool operator() (const string& rawpath) const
32 {
33 return bfs::is_directory(rawpath);
34 }
35};
36
38{
39 bool operator() (const string& rawpath) const
40 {
41 if (bfs::exists(bfs::path(rawpath) / "analysis.tdf")) // no x86 DLL available
42 return true;
43 return false;
44 }
45};
46
47int main(int argc, char* argv[])
48{
49 TEST_PROLOG(argc, argv)
50
51 #ifdef PWIZ_READER_BRUKER
52 const bool testAcceptOnly = false;
53 #else
54 const bool testAcceptOnly = true;
55 #endif
56
57 try
58 {
59 bool requireUnicodeSupport = false;
60
63 pwiz::util::testReader(reader, testArgs, testAcceptOnly, requireUnicodeSupport, IsDirectory(), config);
64
65 config.preferOnlyMsLevel = 1;
66 pwiz::util::testReader(reader, testArgs, testAcceptOnly, requireUnicodeSupport, IsTDF(), config);
67
68 config.preferOnlyMsLevel = 2;
69 pwiz::util::testReader(reader, testArgs, testAcceptOnly, requireUnicodeSupport, IsTDF(), config);
70
71 config.combineIonMobilitySpectra = true;
72 pwiz::util::testReader(reader, testArgs, testAcceptOnly, requireUnicodeSupport, IsTDF(), config);
73
74 config.preferOnlyMsLevel = 1;
75 pwiz::util::testReader(reader, testArgs, testAcceptOnly, requireUnicodeSupport, IsTDF(), config);
76
77 config.preferOnlyMsLevel = 0;
78 pwiz::util::testReader(reader, testArgs, testAcceptOnly, requireUnicodeSupport, IsTDF(), config);
79 }
80 catch (exception& e)
81 {
82 TEST_FAILED(e.what())
83 }
84 catch (...)
85 {
86 TEST_FAILED("Caught unknown exception.")
87 }
88
90}
int main(int argc, char *argv[])
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;.
bool operator()(const string &rawpath) const
returns true iff the given rawpath is a real path to test/generate
bool operator()(const string &rawpath) const
returns true iff the given rawpath is a real path to test/generate
int preferOnlyMsLevel
when nonzero, if reader can enumerate only spectra of ms level, it will (currently only supported by ...
Definition Reader.hpp:74
bool combineIonMobilitySpectra
when true, all drift bins/scans in a frame/block are written in combined form instead of as individua...
Definition Reader.hpp:59
test implementations derive from this to define which paths should be tested
#define TEST_EPILOG
Definition unit.hpp:183
#define TEST_FAILED(x)
Definition unit.hpp:177
#define TEST_PROLOG(argc, argv)
Definition unit.hpp:175