xgboost/tests/cpp/test_learner.h
Philip Hyunsu Cho ad68865d6b
[Blocking] Fix #3840: Clean up logic for parsing tree_method parameter (#3849)
* Clean up logic for converting tree_method to updater sequence

* Use C++11 enum class for extra safety

Compiler will give warnings if switch statements don't handle all
possible values of C++11 enum class.

Also allow enum class to be used as DMLC parameter.

* Fix compiler error + lint

* Address reviewer comment

* Better docstring for DECLARE_FIELD_ENUM_CLASS

* Fix lint

* Add C++ test to see if tree_method is recognized

* Fix clang-tidy error

* Add test_learner.h to R package

* Update comments

* Fix lint error
2018-11-01 19:33:35 -07:00

23 lines
527 B
C++

/*!
* Copyright 2018 by Contributors
* \file test_learner.h
* \brief Hook to access implementation class of Learner
* \author Hyunsu Philip Cho
*/
#ifndef XGBOOST_TESTS_CPP_TEST_LEARNER_H_
#define XGBOOST_TESTS_CPP_TEST_LEARNER_H_
#include <string>
namespace xgboost {
class LearnerTestHook {
private:
virtual std::string GetUpdaterSequence() const = 0;
// allow friend access to C++ tests for Learner
friend class LearnerTestHookAdapter;
};
} // namespace xgboost
#endif // XGBOOST_TESTS_CPP_TEST_LEARNER_H_