ProteoWizard
Reader_Waters_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 2008 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 
24 #include "Reader_Waters.hpp"
28 
30 {
31  bool operator() (const string& rawpath) const
32  {
33  return bfs::is_directory(rawpath) &&
34  bal::iends_with(rawpath, ".raw");
35  }
36 };
37 
39 {
40  bool operator() (const string& rawpath) const
41  {
42  return bfs::is_directory(rawpath) &&
43  bal::iends_with(rawpath, ".raw") &&
44  (bal::istarts_with(bfs::path(rawpath).filename().string(), "HD") || bal::istarts_with(bfs::path(rawpath).filename().string(), "SONAR"));
45  }
46 };
47 
48 int main(int argc, char* argv[])
49 {
50  TEST_PROLOG(argc, argv)
51 
52  #ifdef PWIZ_READER_WATERS
53  const bool testAcceptOnly = false;
54  #else
55  const bool testAcceptOnly = true;
56  #endif
57 
58  try
59  {
60  bool requireUnicodeSupport = false;
61 
64  pwiz::util::testReader(reader, testArgs, testAcceptOnly, requireUnicodeSupport, IsRawData(), config);
65 
66  config.combineIonMobilitySpectra = true;
67  pwiz::util::testReader(reader, testArgs, testAcceptOnly, requireUnicodeSupport, IsIMSData(), config);
68  }
69  catch (exception& e)
70  {
71  TEST_FAILED(e.what())
72  }
73  catch (...)
74  {
75  TEST_FAILED("Caught unknown exception.")
76  }
77 
79 }
pwiz::msdata::Reader::Config::combineIonMobilitySpectra
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
pwiz::util::ReaderTestConfig
Definition: VendorReaderTestHarness.hpp:45
Reader_Waters.hpp
TEST_EPILOG
#define TEST_EPILOG
Definition: unit.hpp:183
IsIMSData::operator()
bool operator()(const string &rawpath) const
returns true iff the given rawpath is a real path to test/generate
Definition: Reader_Waters_Test.cpp:40
Std.hpp
IsRawData
Definition: Reader_Waters_Test.cpp:30
Filesystem.hpp
main
int main(int argc, char *argv[])
Definition: Reader_Waters_Test.cpp:48
pwiz::util::TestPathPredicate
test implementations derive from this to define which paths should be tested
Definition: VendorReaderTestHarness.hpp:36
IsRawData::operator()
bool operator()(const string &rawpath) const
returns true iff the given rawpath is a real path to test/generate
Definition: Reader_Waters_Test.cpp:31
TEST_FAILED
#define TEST_FAILED(x)
Definition: unit.hpp:177
TEST_PROLOG
#define TEST_PROLOG(argc, argv)
Definition: unit.hpp:175
IsIMSData
Definition: Reader_Waters_Test.cpp:39
unit.hpp
VendorReaderTestHarness.hpp
pwiz::msdata::Reader_Waters
Definition: Reader_Waters.hpp:42
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;.