comparison tests/util/main.cpp @ 518:b557017ad3f0

Tests: unify test files for directory/file tests
author David Demelier <markand@malikania.fr>
date Fri, 27 Oct 2017 08:52:39 +0200
parents 16b9ebfd3f08
children e03521cf207b
comparison
equal deleted inserted replaced
517:7b1781724868 518:b557017ad3f0
467 467
468 BOOST_AUTO_TEST_SUITE(fs_find_name) 468 BOOST_AUTO_TEST_SUITE(fs_find_name)
469 469
470 BOOST_AUTO_TEST_CASE(not_recursive) 470 BOOST_AUTO_TEST_CASE(not_recursive)
471 { 471 {
472 auto file1 = util::fs::find(CMAKE_CURRENT_BINARY_DIR "/root", "file-1.txt", false); 472 auto file1 = util::fs::find(TESTS_BINARY_DIR "/root", "file-1.txt", false);
473 auto file2 = util::fs::find(CMAKE_CURRENT_BINARY_DIR "/root", "file-2.txt", false); 473 auto file2 = util::fs::find(TESTS_BINARY_DIR "/root", "file-2.txt", false);
474 474
475 BOOST_TEST(file1.find("file-1.txt") != std::string::npos); 475 BOOST_TEST(file1.find("file-1.txt") != std::string::npos);
476 BOOST_TEST(file2.empty()); 476 BOOST_TEST(file2.empty());
477 } 477 }
478 478
479 BOOST_AUTO_TEST_CASE(recursive) 479 BOOST_AUTO_TEST_CASE(recursive)
480 { 480 {
481 auto file1 = util::fs::find(CMAKE_CURRENT_BINARY_DIR "/root", "file-1.txt", true); 481 auto file1 = util::fs::find(TESTS_BINARY_DIR "/root", "file-1.txt", true);
482 auto file2 = util::fs::find(CMAKE_CURRENT_BINARY_DIR "/root", "file-2.txt", true); 482 auto file2 = util::fs::find(TESTS_BINARY_DIR "/root", "file-2.txt", true);
483 483
484 BOOST_TEST(file1.find("file-1.txt") != std::string::npos); 484 BOOST_TEST(file1.find("file-1.txt") != std::string::npos);
485 BOOST_TEST(file2.find("file-2.txt") != std::string::npos); 485 BOOST_TEST(file2.find("file-2.txt") != std::string::npos);
486 } 486 }
487 487