mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[options] Move gnc-options test to engine/test/CMakeLists.txt.
This commit is contained in:
@@ -157,6 +157,9 @@ set_local_dist(test_guile_DIST_local
|
|||||||
test-print-queries.cpp
|
test-print-queries.cpp
|
||||||
test-scm-query.cpp
|
test-scm-query.cpp
|
||||||
test-scm-query-string.cpp
|
test-scm-query-string.cpp
|
||||||
|
test-options.scm
|
||||||
|
test-gnc-optiondb.scm
|
||||||
|
test-gnc-option-scheme-output.scm
|
||||||
${test_engine_SCHEME_DIST}
|
${test_engine_SCHEME_DIST}
|
||||||
${test_scm_SCHEME}
|
${test_scm_SCHEME}
|
||||||
${test_app_utils_scheme_SOURCES}
|
${test_app_utils_scheme_SOURCES}
|
||||||
|
|||||||
@@ -31,25 +31,6 @@ gnc_add_test_with_guile(test-sx test-sx.cpp
|
|||||||
APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS
|
APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS
|
||||||
)
|
)
|
||||||
|
|
||||||
set(gtest_gnc_option_SOURCES
|
|
||||||
../../engine/test/gtest-gnc-option.cpp
|
|
||||||
../../engine/test/gtest-gnc-optiondb.cpp)
|
|
||||||
|
|
||||||
set(gtest_gnc_option_INCLUDES
|
|
||||||
${MODULEPATH}
|
|
||||||
${CMAKE_SOURCE_DIR}/libgnucash/engine
|
|
||||||
${CMAKE_BINARY_DIR}/common # for config.h
|
|
||||||
${GLIB2_INCLUDE_DIRS}
|
|
||||||
${GUILE_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
set(gtest_gnc_option_LIBS
|
|
||||||
gnc-app-utils
|
|
||||||
gnc-engine
|
|
||||||
${GLIB2_LDFLAGS}
|
|
||||||
${GUILE_LDFLAGS}
|
|
||||||
gtest)
|
|
||||||
|
|
||||||
gnc_add_test(test-gnc-option "${gtest_gnc_option_SOURCES}" gtest_gnc_option_INCLUDES gtest_gnc_option_LIBS)
|
|
||||||
|
|
||||||
set(GUILE_DEPENDS
|
set(GUILE_DEPENDS
|
||||||
scm-test-engine
|
scm-test-engine
|
||||||
@@ -65,13 +46,8 @@ set_dist_list(test_app_utils_DIST
|
|||||||
test-exp-parser.c
|
test-exp-parser.c
|
||||||
test-print-parse-amount.cpp
|
test-print-parse-amount.cpp
|
||||||
test-sx.cpp
|
test-sx.cpp
|
||||||
../../engine/test/gtest-gnc-option.cpp
|
|
||||||
../../engine/test/gtest-gnc-optiondb.cpp
|
|
||||||
test-c-interface.scm
|
test-c-interface.scm
|
||||||
test-date-utilities.scm
|
test-date-utilities.scm
|
||||||
test-options.scm
|
|
||||||
test-gnc-optiondb.scm
|
|
||||||
test-gnc-option-scheme-output.scm
|
|
||||||
${test_app_utils_scheme_SOURCES}
|
${test_app_utils_scheme_SOURCES}
|
||||||
${test_app_utils_SOURCES}
|
${test_app_utils_SOURCES}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -194,6 +194,24 @@ gtest-qofquerycore.cpp)
|
|||||||
gnc_add_test(test-qofquerycore "${test_qofquerycore_SOURCES}"
|
gnc_add_test(test-qofquerycore "${test_qofquerycore_SOURCES}"
|
||||||
gtest_engine_INCLUDES gtest_old_engine_LIBS)
|
gtest_engine_INCLUDES gtest_old_engine_LIBS)
|
||||||
|
|
||||||
|
set(gtest_gnc_option_SOURCES
|
||||||
|
gtest-gnc-option.cpp
|
||||||
|
gtest-gnc-optiondb.cpp)
|
||||||
|
|
||||||
|
set(gtest_gnc_option_INCLUDES
|
||||||
|
${MODULEPATH}
|
||||||
|
${CMAKE_SOURCE_DIR}/libgnucash/engine
|
||||||
|
${CMAKE_BINARY_DIR}/common # for config.h
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
${GUILE_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
set(gtest_gnc_option_LIBS
|
||||||
|
gnc-engine
|
||||||
|
${GLIB2_LDFLAGS}
|
||||||
|
${GUILE_LDFLAGS}
|
||||||
|
gtest)
|
||||||
|
|
||||||
|
gnc_add_test(test-gnc-option "${gtest_gnc_option_SOURCES}" gtest_gnc_option_INCLUDES gtest_gnc_option_LIBS)
|
||||||
|
|
||||||
set(test_engine_SOURCES_DIST
|
set(test_engine_SOURCES_DIST
|
||||||
dummy.cpp
|
dummy.cpp
|
||||||
@@ -202,6 +220,8 @@ set(test_engine_SOURCES_DIST
|
|||||||
gtest-gnc-numeric.cpp
|
gtest-gnc-numeric.cpp
|
||||||
gtest-gnc-timezone.cpp
|
gtest-gnc-timezone.cpp
|
||||||
gtest-gnc-datetime.cpp
|
gtest-gnc-datetime.cpp
|
||||||
|
gtest-gnc-option.cpp
|
||||||
|
gtest-gnc-optiondb.cpp
|
||||||
gtest-import-map.cpp
|
gtest-import-map.cpp
|
||||||
gtest-qofquerycore.cpp
|
gtest-qofquerycore.cpp
|
||||||
test-account-object.cpp
|
test-account-object.cpp
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ extern "C"
|
|||||||
#include "gnc-commodity.h"
|
#include "gnc-commodity.h"
|
||||||
#include "gnc-date.h"
|
#include "gnc-date.h"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "gnc-ui-util.h"
|
|
||||||
#include "gnc-session.h"
|
#include "gnc-session.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +142,8 @@ TEST(GncOption, test_bool_stream_in)
|
|||||||
class GncOptionTest : public ::testing::Test
|
class GncOptionTest : public ::testing::Test
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
GncOptionTest() : m_session{gnc_get_current_session()}, m_book{gnc_get_current_book()} {}
|
GncOptionTest() : m_session{gnc_get_current_session()},
|
||||||
|
m_book{qof_session_get_book(gnc_get_current_session())} {}
|
||||||
~GncOptionTest() { gnc_clear_current_session(); }
|
~GncOptionTest() { gnc_clear_current_session(); }
|
||||||
|
|
||||||
QofSession* m_session;
|
QofSession* m_session;
|
||||||
@@ -200,7 +200,7 @@ class GncOptionCommodityTest : public ::testing::Test
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
GncOptionCommodityTest() : m_session{gnc_get_current_session()},
|
GncOptionCommodityTest() : m_session{gnc_get_current_session()},
|
||||||
m_book{gnc_get_current_book()},
|
m_book{qof_session_get_book(gnc_get_current_session())},
|
||||||
m_table{gnc_commodity_table_new()}
|
m_table{gnc_commodity_table_new()}
|
||||||
{
|
{
|
||||||
/* We can't initialize the commodities with their values because we first must
|
/* We can't initialize the commodities with their values because we first must
|
||||||
@@ -522,7 +522,8 @@ class GncOptionAccountTest : public ::testing::Test
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
GncOptionAccountTest() :
|
GncOptionAccountTest() :
|
||||||
m_session{gnc_get_current_session()}, m_book{gnc_get_current_book()},
|
m_session{gnc_get_current_session()},
|
||||||
|
m_book{qof_session_get_book(gnc_get_current_session())},
|
||||||
m_root{gnc_account_create_root(m_book)}
|
m_root{gnc_account_create_root(m_book)}
|
||||||
{
|
{
|
||||||
auto create_account = [this](Account* parent, GNCAccountType type,
|
auto create_account = [this](Account* parent, GNCAccountType type,
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "gnc-ui-util.h"
|
|
||||||
#include "gnc-session.h"
|
#include "gnc-session.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +103,8 @@ TEST_F(GncOptionDBTest, test_register_report_placement_option)
|
|||||||
struct GncOptionDBAccountTest : public ::testing::Test
|
struct GncOptionDBAccountTest : public ::testing::Test
|
||||||
{
|
{
|
||||||
GncOptionDBAccountTest() :
|
GncOptionDBAccountTest() :
|
||||||
m_sess{gnc_get_current_session()}, m_book{gnc_get_current_book()},
|
m_sess{gnc_get_current_session()},
|
||||||
|
m_book{qof_session_get_book(gnc_get_current_session())},
|
||||||
m_root{gnc_account_create_root(m_book)},
|
m_root{gnc_account_create_root(m_book)},
|
||||||
m_db{std::make_unique<GncOptionDB>()}
|
m_db{std::make_unique<GncOptionDB>()}
|
||||||
{
|
{
|
||||||
@@ -301,7 +301,8 @@ class GncOptionDBIOTest : public ::testing::Test
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
GncOptionDBIOTest() :
|
GncOptionDBIOTest() :
|
||||||
m_book{gnc_get_current_book()}, m_root{gnc_account_create_root(m_book)},
|
m_book{qof_session_get_book(gnc_get_current_session())},
|
||||||
|
m_root{gnc_account_create_root(m_book)},
|
||||||
m_db{std::make_unique<GncOptionDB>()}
|
m_db{std::make_unique<GncOptionDB>()}
|
||||||
{
|
{
|
||||||
auto create_account = [this](Account* parent, GNCAccountType type,
|
auto create_account = [this](Account* parent, GNCAccountType type,
|
||||||
|
|||||||
Reference in New Issue
Block a user