meson.build (13653B)
1 # This build file is in the public domain 2 3 pkgcfgadir = get_option('datadir') / 'taler-auditor' / 'config.d' 4 pkgcfgedir = get_option('datadir') / 'taler-exchange' / 'config.d' 5 6 # Auditor also needs to access the exchange DB, so we install 7 # the exchange configuration for it here as well! 8 install_data( 9 'exchangedb.conf', 10 'exchangedb-postgres.conf', 11 install_dir: pkgcfgadir, 12 ) 13 14 install_data( 15 'exchangedb.conf', 16 'exchangedb-postgres.conf', 17 install_dir: pkgcfgedir, 18 ) 19 20 configure_file( 21 input: 'test-exchange-db-postgres.conf', 22 output: 'test-exchange-db-postgres.conf', 23 copy: true, 24 ) 25 26 subdir('sql-schema') 27 28 test_idem = configure_file( 29 input: 'test_idempotency.sh', 30 output: 'test_idempotency.sh', 31 copy: true, 32 ) 33 34 test( 35 'test_idempotency.sh', 36 test_idem, 37 workdir: meson.current_build_dir(), 38 suite: ['exchangedb', 'installcheck'], 39 is_parallel: false, 40 ) 41 42 43 libtalerexchangedb = library( 44 'talerexchangedb', 45 [ 46 'account_history.c', 47 'bench_db.c', 48 'exchangedb_accounts.c', 49 'exchangedb_transactions.c', 50 'free_coin_transaction_list.c', 51 'free_reserve_history.c', 52 'do_persist_aml_program_result.c', 53 'abort_shard.c', 54 'insert_signkey.c', 55 'do_aggregate.c', 56 'begin_revolving_shard.c', 57 'begin_shard.c', 58 'pg.c', 59 'update_to_aml_unlocked.c', 60 'commit.c', 61 'update_shard_progress.c', 62 'compute_shard.c', 63 'get_count_known_coins.c', 64 'insert_aggregation_deferral.c', 65 'insert_aggregation_transient.c', 66 'create_tables.c', 67 'delete_aggregation_transient.c', 68 'delete_shard_locks.c', 69 'disable_rules.c', 70 'do_check_deposit_idempotent.c', 71 'do_deposit.c', 72 'do_purse_delete.c', 73 'do_purse_deposit.c', 74 'do_purse_merge.c', 75 'do_recoup.c', 76 'do_recoup_refresh.c', 77 'do_refresh.c', 78 'do_refund.c', 79 'do_reserve_open.c', 80 'do_reserve_purse.c', 81 'do_withdraw.c', 82 'do_drain_kyc_alert.c', 83 'drop_tables.c', 84 'enable_rules.c', 85 'do_insert_known_coins.c', 86 'event_listen.c', 87 'event_listen_cancel.c', 88 'event_notify.c', 89 'do_expire_purse.c', 90 'get_aggregation_transient_by_normalized_payto.c', 91 'gc.c', 92 'get_coin_denomination.c', 93 'get_coin_transactions.c', 94 'get_denomination_by_serial.c', 95 'get_denomination_pub_by_serial.c', 96 'get_denomination_info.c', 97 'get_denomination_revocation.c', 98 'get_profit_drain.c', 99 'iterate_expired_reserves.c', 100 'get_global_fee.c', 101 'iterate_global_fees.c', 102 'get_known_coin.c', 103 'get_kyc_rules.c', 104 'get_pending_legitimization_process.c', 105 'get_purse_deposit.c', 106 'get_purse_request.c', 107 'get_ready_deposit.c', 108 'get_refresh.c', 109 'get_reserve_balance.c', 110 'get_reserve_history.c', 111 'get_denomination_proof_for_known_coin.c', 112 'get_signature_for_known_coin.c', 113 'iterate_unfinished_close_requests.c', 114 'iterate_wire_accounts.c', 115 'get_wire_fee.c', 116 'iterate_wire_fees.c', 117 'get_wire_hash_for_contract.c', 118 'get_withdraw.c', 119 'get_exists_deposit.c', 120 'inject_auditor_triggers.c', 121 'insert_active_legitimization_measure.c', 122 'insert_aml_decision.c', 123 'insert_aml_officer.c', 124 'insert_aml_program_failure.c', 125 'insert_auditor.c', 126 'insert_auditor_denom_sig.c', 127 'insert_close_request.c', 128 'insert_contract.c', 129 'insert_denomination_info.c', 130 'insert_denomination_revocation.c', 131 'insert_profit_drain.c', 132 'insert_global_fee.c', 133 'insert_kyc_failure.c', 134 'insert_legitimization_process.c', 135 'insert_partner.c', 136 'insert_purse_request.c', 137 'insert_records_by_table.c', 138 'insert_refund.c', 139 'insert_reserve_closed.c', 140 'insert_reserve_open_deposit.c', 141 'insert_sanction_list_hit.c', 142 'insert_signkey_revocation.c', 143 'insert_successor_measure.c', 144 'insert_wire.c', 145 'insert_wire_fee.c', 146 'iterate_active_auditors.c', 147 'iterate_active_signkeys.c', 148 'iterate_auditor_denominations.c', 149 'iterate_denomination_info.c', 150 'iterate_denominations.c', 151 'iterate_kyc_references.c', 152 'iterate_reserve_close_info.c', 153 'get_kyc_provider_account.c', 154 'get_active_legitimization.c', 155 'get_aml_file_number.c', 156 'iterate_aml_history.c', 157 'iterate_aml_history_above_serial_id.c', 158 'iterate_aml_staff_above_serial_id.c', 159 'iterate_legitimization_outcomes_above_serial_id.c', 160 'get_aml_officer.c', 161 'get_auditor_status.c', 162 'get_auditor_timestamp.c', 163 'get_completed_legitimization.c', 164 'get_denomination_meta.c', 165 'get_global_fee_by_time.c', 166 'get_h_payto_by_access_token.c', 167 'iterate_kyc_history.c', 168 'get_legitimization_process_by_account.c', 169 'get_legitimization_requirement_by_row.c', 170 'get_kyc_status_by_token.c', 171 'get_pending_legitimization.c', 172 'iterate_records_by_table.c', 173 'get_rules_by_access_token.c', 174 'get_serial_by_table.c', 175 'do_sync_refresh.c', 176 'get_signkey.c', 177 'get_signkey_revocation.c', 178 'get_transfer_by_deposit.c', 179 'get_wire_fee_by_time.c', 180 'get_wire_timestamp.c', 181 'iterate_wire_transfers.c', 182 'update_to_refresh_revealed.c', 183 'do_insert_kyc_attributes.c', 184 'preflight.c', 185 'get_pending_profit_drain.c', 186 'update_to_profit_drain_finished.c', 187 'release_revolving_shard.c', 188 'get_reserve.c', 189 'get_reserve_origin.c', 190 'do_import_credits.c', 191 'update_reserve.c', 192 'rollback.c', 193 'iterate_account_merges_above_serial_id.c', 194 'iterate_aggregation_amounts_for_kyc_check.c', 195 'iterate_aggregation_wtids_above_serial_id.c', 196 'iterate_aggregations_above_serial_id.c', 197 'get_aggregation_deferral_by_wtid.c', 198 'get_aggregation_transient.c', 199 'get_aggregation_transient_by_wtid.c', 200 'get_open_legitimization_measure.c', 201 'get_pending_aggregation.c', 202 'iterate_unscreened_kyc_attributes.c', 203 'iterate_all_purse_decisions_above_serial_id.c', 204 'iterate_all_purse_deletions_above_serial_id.c', 205 'iterate_aml_attributes.c', 206 'iterate_aml_decisions.c', 207 'iterate_aml_measures.c', 208 'iterate_aml_statistics.c', 209 'get_auditor_denom_sig.c', 210 'iterate_batch_deposits_missing_wire.c', 211 'iterate_coin_deposits_above_serial_id.c', 212 'get_contract_by_purse.c', 213 'get_contract.c', 214 'iterate_deposit_amounts_for_kyc_check.c', 215 'iterate_exchange_credit_transfers.c', 216 'iterate_exchange_debit_transfers.c', 217 'iterate_exchange_kycauth_transfers.c', 218 'iterate_kyc_accounts.c', 219 'iterate_kyc_attributes.c', 220 'iterate_kycauth_in_above_serial_id_by_account.c', 221 'iterate_merge_amounts_for_kyc_check.c', 222 'get_purse_by_merge_pub.c', 223 'get_purse.c', 224 'iterate_purse_decisions_above_serial_id.c', 225 'iterate_purse_deposits_above_serial_id.c', 226 'iterate_purse_deposits_by_purse.c', 227 'get_purse_merge.c', 228 'iterate_purse_merges_above_serial_id.c', 229 'iterate_purse_requests_above_serial_id.c', 230 'iterate_recoups_above_serial_id.c', 231 'iterate_recoup_refreshes_above_serial_id.c', 232 'iterate_refreshes_above_serial_id.c', 233 'iterate_refunds_above_serial_id.c', 234 'iterate_refunds_by_coin.c', 235 'iterate_reserve_closed_above_serial_id.c', 236 'get_reserve_close_info.c', 237 'get_reserve_close_request_info.c', 238 'iterate_reserve_open_above_serial_id.c', 239 'iterate_reserves_in_above_serial_id_by_account.c', 240 'iterate_reserves_in_above_serial_id.c', 241 'iterate_wallet_merges.c', 242 'iterate_wire_outs_above_serial_id_by_account.c', 243 'iterate_wire_outs_above_serial_id.c', 244 'iterate_withdrawals_above_serial_id.c', 245 'iterate_withdraw_amounts_for_kyc_check.c', 246 'update_to_aml_locked.c', 247 'update_to_kyc_attributes_screened.c', 248 'update_to_kyc_attributes_unscreened.c', 249 'start.c', 250 'start_deferred_wire_out.c', 251 'start_read_committed.c', 252 'start_read_only.c', 253 'insert_wire_out.c', 254 'template.c', 255 'get_exists_aml_officer.c', 256 'do_trigger_kyc_rule_for_account.c', 257 'do_reserve_legitimization_process.c', 258 'update_legitimization_process_start.c', 259 'update_aggregation_transient.c', 260 'update_auditor.c', 261 'update_legitimization_process_by_row.c', 262 'update_wire.c', 263 'iterate_prewires.c', 264 'iterate_prewires_below_open_shards.c', 265 'insert_prewire.c', 266 'update_to_prewire_failed.c', 267 'update_to_prewire_finished.c', 268 'begin_rule_update.c', 269 ], 270 soversion: solibversions['libtalerexchangedb']['soversion'], 271 version: solibversions['libtalerexchangedb']['soversion'], 272 install_rpath: rpath_option, 273 dependencies: [ 274 libtalerbank_dep, 275 libtalerkyclogic_dep, 276 libtalerpq_dep, 277 libtalerjson_dep, 278 libtalerutil_dep, 279 gnunetpq_dep, 280 gnunetjson_dep, 281 gnunetutil_dep, 282 json_dep, 283 curl_dep, 284 pq_dep, 285 ], 286 include_directories: [incdir, configuration_inc], 287 install: true, 288 install_dir: get_option('libdir'), 289 ) 290 291 libtalerexchangedb_dep = declare_dependency(link_with: libtalerexchangedb) 292 pkg.generate( 293 libtalerexchangedb, 294 url: 'https://taler.net', 295 description: 'GNU Taler exchange DB library', 296 ) 297 298 299 test_regressions = executable( 300 'test_regressions', 301 ['test_regressions.c'], 302 install_rpath: rpath_option, 303 dependencies: [ 304 libtalerexchangedb_dep, 305 libtalerutil_dep, 306 libtalerjson_dep, 307 libtalerpq_dep, 308 gnunetutil_dep, 309 gnunetjson_dep, 310 gnunetpq_dep, 311 pq_dep, 312 json_dep, 313 ], 314 include_directories: [incdir, configuration_inc], 315 install: false, 316 ) 317 318 test_regressions_sh = configure_file( 319 input: 'test_regressions.sh', 320 output: 'test_regressions.sh', 321 copy: true, 322 ) 323 324 test( 325 'test_regressions', 326 test_regressions_sh, 327 workdir: meson.current_build_dir(), 328 suite: ['exchangedb'], 329 depends: [test_regressions, exchangedb_sql_targets], 330 env: {'TALER_BUILD_ROOT': meson.project_build_root()}, 331 is_parallel: false, 332 timeout: 300, 333 ) 334 335 336 # One test binary per database table, each covering the exported functions 337 # whose primary test table it is. The '@brief' comment of every function in 338 # src/include/exchange-database/ names the table it belongs to. They all 339 # share test_common.c and the test_table.sh driver, which gives each of them 340 # a scratch database of its own. 341 342 test_table_sh = configure_file( 343 input: 'test_table.sh', 344 output: 'test_table.sh', 345 copy: true, 346 ) 347 348 exchangedb_table_tests = [ 349 'account_merges', 350 'aggregation_deferrals', 351 'aggregation_tracking', 352 'aggregation_transient', 353 'aml_history', 354 'aml_staff', 355 'auditor_denom_sigs', 356 'auditors', 357 'batch_deposits', 358 'close_requests', 359 'coin_deposits', 360 'coin_history', 361 'contracts', 362 'denomination_revocations', 363 'denominations', 364 'exchange_sign_keys', 365 'global_fee', 366 'known_coins', 367 'legitimization_measures', 368 'legitimization_outcomes', 369 'legitimization_processes', 370 'kyc_alerts', 371 'kyc_attributes', 372 'kyc_events', 373 'kyc_targets', 374 'kycauths_in', 375 'misc', 376 'partners', 377 'prewire', 378 'profit_drains', 379 'recoup', 380 'refunds', 381 'recoup_refresh', 382 'refresh', 383 'replication', 384 'reserves', 385 'purse_decision', 386 'purse_deletion', 387 'purse_deposits', 388 'purse_merges', 389 'purse_requests', 390 'reserve_history', 391 'reserves_close', 392 'reserves_in', 393 'reserves_open_deposits', 394 'reserves_open_requests', 395 'revolving_work_shards', 396 'signkey_revocations', 397 'wire_accounts', 398 'withdraw', 399 'wire_fee', 400 'wire_out', 401 'work_shards', 402 ] 403 404 foreach t : exchangedb_table_tests 405 test_bin = executable( 406 'test_' + t, 407 ['test_' + t + '.c', 'test_common.c'], 408 install_rpath: rpath_option, 409 dependencies: [ 410 libtalerexchangedb_dep, 411 libtalerkyclogic_dep, 412 libtalerutil_dep, 413 libtalerjson_dep, 414 libtalerpq_dep, 415 gnunetutil_dep, 416 gnunetjson_dep, 417 gnunetpq_dep, 418 pq_dep, 419 json_dep, 420 ], 421 include_directories: [incdir, configuration_inc], 422 install: false, 423 ) 424 test( 425 'test_' + t, 426 test_table_sh, 427 args: ['test_' + t], 428 workdir: meson.current_build_dir(), 429 suite: ['exchangedb'], 430 depends: [test_bin, exchangedb_sql_targets], 431 env: {'TALER_BUILD_ROOT': meson.project_build_root()}, 432 is_parallel: false, 433 timeout: 300, 434 ) 435 endforeach 436 437 executable( 438 'bench-db-postgres', 439 ['bench_db.c'], 440 install_rpath: rpath_option, 441 dependencies: [ 442 libtalerpq_dep, 443 libtalerutil_dep, 444 gnunetpq_dep, 445 gnunetutil_dep, 446 pq_dep, 447 ], 448 include_directories: [incdir, configuration_inc], 449 install: false, 450 )