QMCPACK
test_QMCDriverInput.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2019 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 //
9 // File created by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #include "catch.hpp"
14 
18 #include "OhmmsData/Libxml2Doc.h"
19 
20 namespace qmcplusplus
21 {
22 TEST_CASE("QMCDriverInput Instantiation", "[drivers]") { QMCDriverInput driver_input; }
23 
24 TEST_CASE("QMCDriverInput readXML", "[drivers]")
25 {
26  auto xml_test = [](const char* driver_xml) {
28  bool okay = doc.parseFromString(driver_xml);
29  REQUIRE(okay);
30  xmlNodePtr node = doc.getRoot();
31  QMCDriverInput qmcdriver_input;
32  qmcdriver_input.readXML(node);
33  REQUIRE(qmcdriver_input.get_qmc_method().size() > 0);
34  };
35 
37  testing::valid_vmc_input_sections.end(), xml_test);
38 
40  testing::valid_dmc_input_sections.end(), xml_test);
41 }
42 } // namespace qmcplusplus
class that handles xmlDoc
Definition: Libxml2Doc.h:76
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
if(!okay) throw std xmlNodePtr node
TEST_CASE("complex_helper", "[type_traits]")
xmlNodePtr getRoot()
Definition: Libxml2Doc.h:88
constexpr int valid_vmc_input_vmc_batch_index
REQUIRE(std::filesystem::exists(filename))
Compilation units that construct QMCDriverInput need visibility to the actual input classes types in ...
constexpr std::array< const char *, 4 > valid_vmc_input_sections
constexpr int valid_dmc_input_dmc_batch_index
void readXML(xmlNodePtr cur)
Reads qmc section xml node parameters.
bool parseFromString(const std::string_view data)
Definition: Libxml2Doc.cpp:204
constexpr std::array< const char *, 3 > valid_dmc_input_sections
const std::string & get_qmc_method() const
avoids many repeated xml heredoc sections
Input representation for Driver base class runtime parameters.