Skip to content

Commit f67b53a

Browse files
committed
Xml backend tests: Use libgnc-backend-xml-utils instead of sources.
Every test was rebuilding it except for gnc-backend-xml.cpp from scratch, no point in that plus the Address Sanitizer needs the definition of GncBackendXml.
1 parent fa119f8 commit f67b53a

File tree

1 file changed

+9
-43
lines changed

1 file changed

+9
-43
lines changed

libgnucash/backend/xml/test/CMakeLists.txt

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,6 @@ function(add_xml_gtest _TARGET _SOURCE_FILES)
2626
target_compile_options(${_TARGET} PRIVATE -DU_SHOW_CPLUSPLUS_API=0 -DG_LOG_DOMAIN=\"gnc.backend.xml\")
2727
endfunction()
2828

29-
################################
30-
31-
set(test_backend_xml_base_SOURCES
32-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/sixtp-dom-parsers.cpp
33-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/sixtp-dom-generators.cpp
34-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/sixtp-utils.cpp
35-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/sixtp.cpp
36-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/sixtp-stack.cpp
37-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/sixtp-to-dom-parser.cpp
38-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-xml-helper.cpp
39-
)
40-
41-
## the xml backend is now a GModule - this test does
42-
## not load it as a module and cannot link to it
43-
## and remain portable.
44-
45-
set(test_backend_xml_module_SOURCES
46-
${test_backend_xml_base_SOURCES}
47-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/io-example-account.cpp
48-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/io-gncxml-gen.cpp
49-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/io-gncxml-v2.cpp
50-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/io-utils.cpp
51-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-account-xml-v2.cpp
52-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-budget-xml-v2.cpp
53-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-lot-xml-v2.cpp
54-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-recurrence-xml-v2.cpp
55-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp
56-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-freqspec-xml-v2.cpp
57-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
58-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-commodity-xml-v2.cpp
59-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-book-xml-v2.cpp
60-
${CMAKE_SOURCE_DIR}/libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp
61-
)
62-
6329
set_local_dist(test_backend_xml_DIST_local
6430
CMakeLists.txt
6531
grab-types.pl
@@ -84,8 +50,8 @@ set_local_dist(test_backend_xml_DIST_local
8450
)
8551
set(test_backend_xml_DIST ${test_backend_xml_DIST_local} ${test_backend_xml_test_files_DIST} PARENT_SCOPE)
8652

87-
add_xml_test(test-dom-converters1 "${test_backend_xml_base_SOURCES};test-dom-converters1.cpp")
88-
add_xml_test(test-kvp-frames "${test_backend_xml_base_SOURCES};test-kvp-frames.cpp")
53+
add_xml_test(test-dom-converters1 "test-dom-converters1.cpp")
54+
add_xml_test(test-kvp-frames "test-kvp-frames.cpp")
8955
add_xml_test(test-load-backend test-load-backend.cpp)
9056
add_xml_test(test-load-xml2 test-load-xml2.cpp
9157
GNC_TEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/test-files/xml2
@@ -96,19 +62,19 @@ add_xml_test(test-load-xml2 test-load-xml2.cpp
9662
#)
9763

9864
add_xml_test(test-load-example-account
99-
"${test_backend_xml_module_SOURCES};test-load-example-account.cpp"
65+
"test-load-example-account.cpp"
10066
GNC_ACCOUNT_PATH=${CMAKE_SOURCE_DIR}/data/accounts/C
10167
)
10268
target_compile_options(test-load-example-account PRIVATE -DU_SHOW_CPLUSPLUS_API=0)
10369
add_xml_gtest(test-load-save-files gtest-load-save-files.cpp
10470
GNC_TEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/test-files/load-save
10571
)
106-
add_xml_test(test-string-converters "${test_backend_xml_base_SOURCES};test-string-converters.cpp")
107-
add_xml_test(test-xml-account "${test_backend_xml_module_SOURCES};test-xml-account.cpp;test-file-stuff.cpp")
108-
add_xml_test(test-xml-commodity "${test_backend_xml_module_SOURCES};test-xml-commodity.cpp;test-file-stuff.cpp")
109-
add_xml_test(test-xml-pricedb "${test_backend_xml_module_SOURCES};test-xml-pricedb.cpp;test-file-stuff.cpp")
110-
add_xml_test(test-xml-transaction "${test_backend_xml_module_SOURCES};test-xml-transaction.cpp;test-file-stuff.cpp")
111-
add_xml_test(test-xml2-is-file "${test_backend_xml_module_SOURCES};test-xml2-is-file.cpp"
72+
add_xml_test(test-string-converters "test-string-converters.cpp")
73+
add_xml_test(test-xml-account "test-xml-account.cpp;test-file-stuff.cpp")
74+
add_xml_test(test-xml-commodity "test-xml-commodity.cpp;test-file-stuff.cpp")
75+
add_xml_test(test-xml-pricedb "test-xml-pricedb.cpp;test-file-stuff.cpp")
76+
add_xml_test(test-xml-transaction "test-xml-transaction.cpp;test-file-stuff.cpp")
77+
add_xml_test(test-xml2-is-file "test-xml2-is-file.cpp"
11278
GNC_TEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/test-files/xml2)
11379

11480
set(test-real-data-env

0 commit comments

Comments
 (0)