create db with sellers and articles
This commit is contained in:
parent
79d96c22bc
commit
9705426c31
4 changed files with 51 additions and 8 deletions
|
@ -1,9 +1,9 @@
|
|||
find_package(Boost COMPONENTS filesystem unit_test_framework REQUIRED)
|
||||
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
|
||||
|
||||
add_executable(test_seller test_seller.cpp)
|
||||
target_link_libraries(test_seller core Boost::unit_test_framework)
|
||||
add_test(Seller ${CMAKE_BINARY_DIR}/bin/test_seller)
|
||||
|
||||
add_executable(test_database test_database.cpp)
|
||||
target_link_libraries(test_database core Boost::filesystem Boost::unit_test_framework)
|
||||
target_link_libraries(test_database core Boost::unit_test_framework stdc++fs)
|
||||
add_test(Database ${CMAKE_BINARY_DIR}/bin/test_database)
|
||||
|
|
|
@ -2,10 +2,15 @@
|
|||
|
||||
#include "../src/core/database.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
//using namespace boost::unit_test;
|
||||
|
||||
BOOST_AUTO_TEST_CASE( create_database ) {
|
||||
Database db("test.db");
|
||||
std::filesystem::path testPath = std::filesystem::temp_directory_path() / "test.db";
|
||||
Database db(testPath.c_str());
|
||||
db.init();
|
||||
std::filesystem::remove(testPath);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue