Add travis sanitizers tests. (#3557)

* Add travis sanitizers tests.

* Add gcc-7 in Travis.
* Add SANITIZER_PATH for CMake.
* Enable sanitizer tests in Travis.

* Fix memory leaks in tests.

* Fix all memory leaks reported by Address Sanitizer.
* tests/cpp/helpers.h/CreateDMatrix now returns raw pointer.
This commit is contained in:
trivialfis
2018-08-19 12:40:30 +08:00
committed by Rory Mitchell
parent 983cb0b374
commit cf2d86a4f6
30 changed files with 221 additions and 76 deletions

View File

@@ -21,6 +21,8 @@ TEST(SparsePageDMatrix, MetaInfo) {
// Clean up of external memory files
std::remove((tmp_file + ".cache").c_str());
std::remove((tmp_file + ".cache.row.page").c_str());
delete dmat;
}
TEST(SparsePageDMatrix, RowAccess) {
@@ -48,6 +50,8 @@ TEST(SparsePageDMatrix, RowAccess) {
// Clean up of external memory files
std::remove((tmp_file + ".cache").c_str());
std::remove((tmp_file + ".cache.row.page").c_str());
delete dmat;
}
TEST(SparsePageDMatrix, ColAcess) {
@@ -84,4 +88,6 @@ TEST(SparsePageDMatrix, ColAcess) {
std::remove((tmp_file + ".cache").c_str());
std::remove((tmp_file + ".cache.col.page").c_str());
std::remove((tmp_file + ".cache.row.page").c_str());
delete dmat;
}