|
| 1 | +add_executable(clio_tests) |
| 2 | + |
| 3 | +target_sources( |
| 4 | + clio_tests |
| 5 | + PRIVATE # Common |
| 6 | + ConfigTests.cpp |
| 7 | + data/BackendCountersTests.cpp |
| 8 | + data/BackendFactoryTests.cpp |
| 9 | + data/BackendInterfaceTests.cpp |
| 10 | + data/cassandra/AsyncExecutorTests.cpp |
| 11 | + # Webserver |
| 12 | + data/cassandra/BackendTests.cpp |
| 13 | + data/cassandra/BaseTests.cpp |
| 14 | + data/cassandra/ExecutionStrategyTests.cpp |
| 15 | + data/cassandra/RetryPolicyTests.cpp |
| 16 | + data/cassandra/SettingsProviderTests.cpp |
| 17 | + DOSGuardTests.cpp |
| 18 | + etl/AmendmentBlockHandlerTests.cpp |
| 19 | + etl/CacheLoaderSettingsTests.cpp |
| 20 | + etl/CacheLoaderTests.cpp |
| 21 | + etl/CursorFromAccountProviderTests.cpp |
| 22 | + etl/CursorFromDiffProviderTests.cpp |
| 23 | + etl/CursorFromFixDiffNumProviderTests.cpp |
| 24 | + etl/ETLStateTests.cpp |
| 25 | + etl/ExtractionDataPipeTests.cpp |
| 26 | + etl/ExtractorTests.cpp |
| 27 | + etl/ForwardingCacheTests.cpp |
| 28 | + etl/ForwardingSourceTests.cpp |
| 29 | + etl/GrpcSourceTests.cpp |
| 30 | + etl/LedgerPublisherTests.cpp |
| 31 | + etl/SourceTests.cpp |
| 32 | + etl/SubscriptionSourceDependenciesTests.cpp |
| 33 | + etl/SubscriptionSourceTests.cpp |
| 34 | + etl/TransformerTests.cpp |
| 35 | + # RPC |
| 36 | + feed/BookChangesFeedTests.cpp |
| 37 | + feed/ForwardFeedTests.cpp |
| 38 | + feed/LedgerFeedTests.cpp |
| 39 | + feed/ProposedTransactionFeedTests.cpp |
| 40 | + feed/SingleFeedBaseTests.cpp |
| 41 | + feed/SubscriptionManagerTests.cpp |
| 42 | + feed/TrackableSignalTests.cpp |
| 43 | + feed/TransactionFeedTests.cpp |
| 44 | + JsonUtilTests.cpp |
| 45 | + LoggerTests.cpp |
| 46 | + Main.cpp |
| 47 | + Playground.cpp |
| 48 | + ProfilerTests.cpp |
| 49 | + rpc/AmendmentsTests.cpp |
| 50 | + rpc/APIVersionTests.cpp |
| 51 | + rpc/BaseTests.cpp |
| 52 | + rpc/CountersTests.cpp |
| 53 | + rpc/ErrorTests.cpp |
| 54 | + rpc/ForwardingProxyTests.cpp |
| 55 | + rpc/handlers/AccountChannelsTests.cpp |
| 56 | + rpc/handlers/AccountCurrenciesTests.cpp |
| 57 | + rpc/handlers/AccountInfoTests.cpp |
| 58 | + rpc/handlers/AccountLinesTests.cpp |
| 59 | + rpc/handlers/AccountNFTsTests.cpp |
| 60 | + rpc/handlers/AccountObjectsTests.cpp |
| 61 | + rpc/handlers/AccountOffersTests.cpp |
| 62 | + rpc/handlers/AccountTxTests.cpp |
| 63 | + rpc/handlers/AMMInfoTests.cpp |
| 64 | + # Backend |
| 65 | + rpc/handlers/BookChangesTests.cpp |
| 66 | + rpc/handlers/BookOffersTests.cpp |
| 67 | + rpc/handlers/DefaultProcessorTests.cpp |
| 68 | + rpc/handlers/DepositAuthorizedTests.cpp |
| 69 | + rpc/handlers/GatewayBalancesTests.cpp |
| 70 | + rpc/handlers/LedgerDataTests.cpp |
| 71 | + rpc/handlers/LedgerEntryTests.cpp |
| 72 | + rpc/handlers/LedgerRangeTests.cpp |
| 73 | + rpc/handlers/LedgerTests.cpp |
| 74 | + rpc/handlers/NFTBuyOffersTests.cpp |
| 75 | + rpc/handlers/NFTHistoryTests.cpp |
| 76 | + rpc/handlers/NFTInfoTests.cpp |
| 77 | + rpc/handlers/NFTsByIssuerTest.cpp |
| 78 | + rpc/handlers/NFTSellOffersTests.cpp |
| 79 | + rpc/handlers/NoRippleCheckTests.cpp |
| 80 | + rpc/handlers/PingTests.cpp |
| 81 | + rpc/handlers/RandomTests.cpp |
| 82 | + rpc/handlers/ServerInfoTests.cpp |
| 83 | + rpc/handlers/SubscribeTests.cpp |
| 84 | + rpc/handlers/TestHandlerTests.cpp |
| 85 | + rpc/handlers/TransactionEntryTests.cpp |
| 86 | + rpc/handlers/TxTests.cpp |
| 87 | + rpc/handlers/UnsubscribeTests.cpp |
| 88 | + rpc/handlers/VersionHandlerTests.cpp |
| 89 | + rpc/JsonBoolTests.cpp |
| 90 | + # RPC handlers |
| 91 | + rpc/RPCHelpersTests.cpp |
| 92 | + rpc/WorkQueueTests.cpp |
| 93 | + util/AssertTests.cpp |
| 94 | + util/async/AnyExecutionContextTests.cpp |
| 95 | + util/async/AnyOperationTests.cpp |
| 96 | + util/async/AnyStopTokenTests.cpp |
| 97 | + util/async/AnyStrandTests.cpp |
| 98 | + util/async/AsyncExecutionContextTests.cpp |
| 99 | + # Requests framework |
| 100 | + util/BatchingTests.cpp |
| 101 | + util/LedgerUtilsTests.cpp |
| 102 | + # Prometheus support |
| 103 | + util/prometheus/BoolTests.cpp |
| 104 | + util/prometheus/CounterTests.cpp |
| 105 | + util/prometheus/GaugeTests.cpp |
| 106 | + util/prometheus/HistogramTests.cpp |
| 107 | + util/prometheus/HttpTests.cpp |
| 108 | + util/prometheus/LabelTests.cpp |
| 109 | + util/prometheus/MetricBuilderTests.cpp |
| 110 | + util/prometheus/MetricsFamilyTests.cpp |
| 111 | + util/prometheus/OStreamTests.cpp |
| 112 | + util/requests/RequestBuilderTests.cpp |
| 113 | + util/requests/SslContextTests.cpp |
| 114 | + util/requests/WsConnectionTests.cpp |
| 115 | + # ETL |
| 116 | + util/RetryTests.cpp |
| 117 | + # Async framework |
| 118 | + util/StringUtils.cpp |
| 119 | + util/TestGlobals.cpp |
| 120 | + util/TestHttpServer.cpp |
| 121 | + util/TestObject.cpp |
| 122 | + util/TestWsServer.cpp |
| 123 | + util/TxUtilTests.cpp |
| 124 | + web/AdminVerificationTests.cpp |
| 125 | + web/RPCServerHandlerTests.cpp |
| 126 | + web/ServerTests.cpp |
| 127 | + web/SweepHandlerTests.cpp |
| 128 | + # Feed |
| 129 | + web/WhitelistHandlerTests.cpp |
| 130 | +) |
| 131 | + |
| 132 | +include(deps/gtest) |
| 133 | + |
| 134 | +# See https://github.com/google/googletest/issues/3475 |
| 135 | +gtest_discover_tests(clio_tests DISCOVERY_TIMEOUT 90) |
| 136 | + |
| 137 | +# Fix for dwarf5 bug on ci |
| 138 | +target_compile_options(clio_options INTERFACE -gdwarf-4) |
| 139 | + |
| 140 | +target_compile_definitions(clio_tests PUBLIC UNITTEST_BUILD) |
| 141 | +target_include_directories(clio_tests PRIVATE .) |
| 142 | +target_link_libraries(clio_tests PUBLIC clio gtest::gtest) |
| 143 | +set_target_properties(clio_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) |
| 144 | + |
| 145 | +# Generate `coverage_report` target if coverage is enabled |
| 146 | +if (coverage) |
| 147 | + if (DEFINED CODE_COVERAGE_REPORT_FORMAT) |
| 148 | + set(CODE_COVERAGE_FORMAT ${CODE_COVERAGE_REPORT_FORMAT}) |
| 149 | + else () |
| 150 | + set(CODE_COVERAGE_FORMAT html-details) |
| 151 | + endif () |
| 152 | + |
| 153 | + if (DEFINED CODE_COVERAGE_TESTS_ARGS) |
| 154 | + set(TESTS_ADDITIONAL_ARGS ${CODE_COVERAGE_TESTS_ARGS}) |
| 155 | + separate_arguments(TESTS_ADDITIONAL_ARGS) |
| 156 | + else () |
| 157 | + set(TESTS_ADDITIONAL_ARGS "") |
| 158 | + endif () |
| 159 | + |
| 160 | + set(GCOVR_ADDITIONAL_ARGS --exclude-throw-branches -s) |
| 161 | + |
| 162 | + setup_target_for_coverage_gcovr( |
| 163 | + NAME |
| 164 | + coverage_report |
| 165 | + FORMAT |
| 166 | + ${CODE_COVERAGE_FORMAT} |
| 167 | + EXECUTABLE |
| 168 | + clio_tests |
| 169 | + EXECUTABLE_ARGS |
| 170 | + --gtest_brief=1 |
| 171 | + ${TESTS_ADDITIONAL_ARGS} |
| 172 | + EXCLUDE |
| 173 | + "unittests" |
| 174 | + DEPENDENCIES |
| 175 | + clio_tests |
| 176 | + ) |
| 177 | +endif () |
0 commit comments