Debian Codegraph @

tests/unit_tests/CMakeLists.txt

raw
1 # Copyright (c) 2014-2022, The Monero Project
2 #
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without modification, are
6 # permitted provided that the following conditions are met:
7 #
8 # 1. Redistributions of source code must retain the above copyright notice, this list of
9 # conditions and the following disclaimer.
10 #
11 # 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 # of conditions and the following disclaimer in the documentation and/or other
13 # materials provided with the distribution.
14 #
15 # 3. Neither the name of the copyright holder nor the names of its contributors may be
16 # used to endorse or promote products derived from this software without specific
17 # prior written permission.
18 #
19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 set(unit_tests_sources
30 account.cpp
31 apply_permutation.cpp
32 address_from_url.cpp
33 base58.cpp
34 blockchain_db.cpp
35 block_queue.cpp
36 block_reward.cpp
37 bootstrap_node_selector.cpp
38 bulletproofs.cpp
39 bulletproofs_plus.cpp
40 canonical_amounts.cpp
41 chacha.cpp
42 checkpoints.cpp
43 command_line.cpp
44 crypto.cpp
45 decompose_amount_into_digits.cpp
46 device.cpp
47 difficulty.cpp
48 dns_resolver.cpp
49 epee_boosted_tcp_server.cpp
50 epee_levin_protocol_handler_async.cpp
51 epee_http_server.cpp
52 epee_serialization.cpp
53 epee_utils.cpp
54 expect.cpp
55 fee.cpp
56 json_serialization.cpp
57 get_xtype_from_string.cpp
58 hashchain.cpp
59 hmac_keccak.cpp
60 http.cpp
61 keccak.cpp
62 levin.cpp
63 logging.cpp
64 long_term_block_weight.cpp
65 lmdb.cpp
66 main.cpp
67 memwipe.cpp
68 mlocker.cpp
69 mnemonics.cpp
70 mul_div.cpp
71 multiexp.cpp
72 multisig.cpp
73 net.cpp
74 node_server.cpp
75 notify.cpp
76 output_distribution.cpp
77 parse_amount.cpp
78 pruning.cpp
79 random.cpp
80 rolling_median.cpp
81 scaling_2021.cpp
82 serialization.cpp
83 sha256.cpp
84 slow_memmem.cpp
85 subaddress.cpp
86 test_tx_utils.cpp
87 test_peerlist.cpp
88 test_protocol_pack.cpp
89 threadpool.cpp
90 tx_proof.cpp
91 hardfork.cpp
92 unbound.cpp
93 uri.cpp
94 util.cpp
95 varint.cpp
96 ver_rct_non_semantics_simple_cached.cpp
97 ringct.cpp
98 output_selection.cpp
99 vercmp.cpp
100 ringdb.cpp
101 wallet_storage.cpp
102 wipeable_string.cpp
103 is_hdd.cpp
104 aligned.cpp
105 rpc_version_str.cpp
106 zmq_rpc.cpp)
107
108 set(unit_tests_headers
109 unit_tests_utils.h)
110
111 monero_add_minimal_executable(unit_tests
112 ${unit_tests_sources}
113 ${unit_tests_headers})
114 target_link_libraries(unit_tests
115 PRIVATE
116 ringct
117 cryptonote_protocol
118 cryptonote_core
119 daemon_messages
120 daemon_rpc_server
121 blockchain_db
122 lmdb_lib
123 rpc
124 net
125 serialization
126 wallet
127 p2p
128 version
129 ${Boost_CHRONO_LIBRARY}
130 ${Boost_THREAD_LIBRARY}
131 ${GTEST_LIBRARIES}
132 ${CMAKE_THREAD_LIBS_INIT}
133 ${EXTRA_LIBRARIES}
134 ${ZMQ_LIB})
135 set_property(TARGET unit_tests
136 PROPERTY
137 FOLDER "tests")
138
139 if (NOT MSVC)
140 set_property(TARGET unit_tests
141 APPEND_STRING
142 PROPERTY
143 COMPILE_FLAGS " -Wno-undef -Wno-sign-compare")
144 endif ()
145
146 SET_PROPERTY(SOURCE main.cpp PROPERTY COMPILE_FLAGS -DDEFAULT_DATA_DIR="\\"${CMAKE_SOURCE_DIR}/tests/data\\"")
147
148 SET_PROPERTY(SOURCE memwipe.cpp PROPERTY COMPILE_FLAGS -Ofast)
149
150 add_test(
151 NAME unit_tests
152 COMMAND unit_tests --data-dir "${TEST_DATA_DIR}")
153
154 monero_add_minimal_executable(test_notifier test_notifier.cpp)
155 target_link_libraries(test_notifier ${EXTRA_LIBRARIES})
156 set_property(TARGET test_notifier PROPERTY FOLDER "tests")