1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
|
diff --git a/configs/azure_c_shared_utilityFunctions.cmake b/configs/azure_c_shared_utilityFunctions.cmake
index 6c2f415..e6133af 100644
--- a/configs/azure_c_shared_utilityFunctions.cmake
+++ b/configs/azure_c_shared_utilityFunctions.cmake
@@ -2,11 +2,11 @@
#Licensed under the MIT license. See LICENSE file in the project root for full license information.
function(target_link_libraries_with_arg_prefix arg_prefix whatIsBuilding lib)
- if(${arg_prefix} STREQUAL "debug")
+ if(arg_prefix STREQUAL "debug")
target_link_libraries(${whatIsBuilding} debug ${lib})
- elseif(${arg_prefix} STREQUAL "optimized")
+ elseif(arg_prefix STREQUAL "optimized")
target_link_libraries(${whatIsBuilding} optimized ${lib})
- elseif(${arg_prefix} STREQUAL "general")
+ elseif(arg_prefix STREQUAL "general")
target_link_libraries(${whatIsBuilding} general ${lib})
else()
target_link_libraries(${whatIsBuilding} ${lib})
@@ -43,13 +43,13 @@ function(windows_unittests_add_dll whatIsBuilding)
set(ARG_PREFIX "none")
foreach(f ${ARGN})
set(skip_to_next FALSE)
- if(${f} STREQUAL "ADDITIONAL_LIBS")
+ if(f STREQUAL "ADDITIONAL_LIBS")
SET(PARSING_ADDITIONAL_LIBS ON)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE OFF)
set(ARG_PREFIX "none")
#also unset all the other states
set(skip_to_next TRUE)
- elseif(${f} STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
+ elseif(f STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
SET(PARSING_ADDITIONAL_LIBS OFF)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE ON)
set(skip_to_next TRUE)
@@ -57,7 +57,7 @@ function(windows_unittests_add_dll whatIsBuilding)
if(NOT skip_to_next)
if(PARSING_ADDITIONAL_LIBS)
- if((${f} STREQUAL "debug") OR (${f} STREQUAL "optimized") OR (${f} STREQUAL "general"))
+ if((f STREQUAL "debug") OR (f STREQUAL "optimized") OR (f STREQUAL "general"))
SET(ARG_PREFIX ${f})
else()
target_link_libraries_with_arg_prefix(${ARG_PREFIX} ${whatIsBuilding}_dll ${f})
@@ -90,13 +90,13 @@ function(windows_unittests_add_exe whatIsBuilding)
set(ARG_PREFIX "none")
foreach(f ${ARGN})
set(skip_to_next FALSE)
- if(${f} STREQUAL "ADDITIONAL_LIBS")
+ if(f STREQUAL "ADDITIONAL_LIBS")
SET(PARSING_ADDITIONAL_LIBS ON)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE OFF)
set(ARG_PREFIX "none")
#also unset all the other states
set(skip_to_next TRUE)
- elseif(${f} STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
+ elseif(f STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
SET(PARSING_ADDITIONAL_LIBS OFF)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE ON)
set(skip_to_next TRUE)
@@ -104,7 +104,7 @@ function(windows_unittests_add_exe whatIsBuilding)
if(NOT skip_to_next)
if(PARSING_ADDITIONAL_LIBS)
- if((${f} STREQUAL "debug") OR (${f} STREQUAL "optimized") OR (${f} STREQUAL "general"))
+ if((f STREQUAL "debug") OR (f STREQUAL "optimized") OR (f STREQUAL "general"))
SET(ARG_PREFIX ${f})
else()
target_link_libraries_with_arg_prefix(${ARG_PREFIX} ${whatIsBuilding}_exe ${f})
@@ -150,14 +150,14 @@ function(linux_unittests_add_exe whatIsBuilding)
set(ARG_PREFIX "none")
foreach(f ${ARGN})
set(skip_to_next FALSE)
- if(${f} STREQUAL "ADDITIONAL_LIBS")
+ if(f STREQUAL "ADDITIONAL_LIBS")
SET(PARSING_ADDITIONAL_LIBS ON)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE OFF)
set(ARG_PREFIX "none")
set(skip_to_next TRUE)
#also unset all the other states
- elseif(${f} STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
+ elseif(f STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
SET(PARSING_ADDITIONAL_LIBS OFF)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE ON)
set(skip_to_next TRUE)
@@ -165,7 +165,7 @@ function(linux_unittests_add_exe whatIsBuilding)
if(NOT skip_to_next)
if(PARSING_ADDITIONAL_LIBS)
- if((${f} STREQUAL "debug") OR (${f} STREQUAL "optimized") OR (${f} STREQUAL "general"))
+ if((f STREQUAL "debug") OR (f STREQUAL "optimized") OR (f STREQUAL "general"))
SET(ARG_PREFIX ${f})
else()
target_link_libraries_with_arg_prefix(${ARG_PREFIX} ${whatIsBuilding}_exe ${f})
@@ -184,7 +184,7 @@ function(linux_unittests_add_exe whatIsBuilding)
if(${run_valgrind})
find_program(VALGRIND_FOUND NAMES valgrind)
- if(${VALGRIND_FOUND} STREQUAL VALGRIND_FOUND-NOTFOUND)
+ if(VALGRIND_FOUND STREQUAL VALGRIND_FOUND-NOTFOUND)
message(WARNING "run_valgrind was TRUE, but valgrind was not found - there will be no tests run under valgrind")
else()
add_test(NAME ${whatIsBuilding}_valgrind COMMAND valgrind --num-callers=100 --error-exitcode=1 --leak-check=full --track-origins=yes ${VALGRIND_SUPPRESSIONS_FILE_EXTRA_PARAMETER} $<TARGET_FILE:${whatIsBuilding}_exe>)
@@ -307,13 +307,13 @@ function(c_windows_unittests_add_dll whatIsBuilding folder)
set(ARG_PREFIX "none")
foreach(f ${ARGN})
set(skip_to_next FALSE)
- if(${f} STREQUAL "ADDITIONAL_LIBS")
+ if(f STREQUAL "ADDITIONAL_LIBS")
SET(PARSING_ADDITIONAL_LIBS ON)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE OFF)
set(ARG_PREFIX "none")
#also unset all the other states
set(skip_to_next TRUE)
- elseif(${f} STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
+ elseif(f STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
SET(PARSING_ADDITIONAL_LIBS OFF)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE ON)
set(skip_to_next TRUE)
@@ -321,7 +321,7 @@ function(c_windows_unittests_add_dll whatIsBuilding folder)
if(NOT skip_to_next)
if(PARSING_ADDITIONAL_LIBS)
- if((${f} STREQUAL "debug") OR (${f} STREQUAL "optimized") OR (${f} STREQUAL "general"))
+ if((f STREQUAL "debug") OR (f STREQUAL "optimized") OR (f STREQUAL "general"))
SET(ARG_PREFIX ${f})
else()
target_link_libraries_with_arg_prefix(${ARG_PREFIX} ${whatIsBuilding}_dll ${f})
@@ -369,13 +369,13 @@ function(c_windows_unittests_add_exe whatIsBuilding folder)
set(ARG_PREFIX "none")
foreach(f ${ARGN})
set(skip_to_next FALSE)
- if(${f} STREQUAL "ADDITIONAL_LIBS")
+ if(f STREQUAL "ADDITIONAL_LIBS")
SET(PARSING_ADDITIONAL_LIBS ON)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE OFF)
set(ARG_PREFIX "none")
#also unset all the other states
set(skip_to_next TRUE)
- elseif(${f} STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
+ elseif(f STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
SET(PARSING_ADDITIONAL_LIBS OFF)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE ON)
set(skip_to_next TRUE)
@@ -383,7 +383,7 @@ function(c_windows_unittests_add_exe whatIsBuilding folder)
if(NOT skip_to_next)
if(PARSING_ADDITIONAL_LIBS)
- if((${f} STREQUAL "debug") OR (${f} STREQUAL "optimized") OR (${f} STREQUAL "general"))
+ if((f STREQUAL "debug") OR (f STREQUAL "optimized") OR (f STREQUAL "general"))
SET(ARG_PREFIX ${f})
else()
target_link_libraries_with_arg_prefix(${ARG_PREFIX} ${whatIsBuilding}_exe ${f})
@@ -429,13 +429,13 @@ function(c_linux_unittests_add_exe whatIsBuilding folder)
set(ARG_PREFIX "none")
foreach(f ${ARGN})
set(skip_to_next FALSE)
- if(${f} STREQUAL "ADDITIONAL_LIBS")
+ if(f STREQUAL "ADDITIONAL_LIBS")
SET(PARSING_ADDITIONAL_LIBS ON)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE OFF)
set(ARG_PREFIX "none")
#also unset all the other states
set(skip_to_next TRUE)
- elseif(${f} STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
+ elseif(f STREQUAL "VALGRIND_SUPPRESSIONS_FILE")
SET(PARSING_ADDITIONAL_LIBS OFF)
SET(PARSING_VALGRIND_SUPPRESSIONS_FILE ON)
set(skip_to_next TRUE)
@@ -443,7 +443,7 @@ function(c_linux_unittests_add_exe whatIsBuilding folder)
if(NOT skip_to_next)
if(PARSING_ADDITIONAL_LIBS)
- if((${f} STREQUAL "debug") OR (${f} STREQUAL "optimized") OR (${f} STREQUAL "general"))
+ if((f STREQUAL "debug") OR (f STREQUAL "optimized") OR (f STREQUAL "general"))
SET(ARG_PREFIX ${f})
else()
target_link_libraries_with_arg_prefix(${ARG_PREFIX} ${whatIsBuilding}_exe ${f})
@@ -462,7 +462,7 @@ function(c_linux_unittests_add_exe whatIsBuilding folder)
if(${run_valgrind})
find_program(VALGRIND_FOUND NAMES valgrind)
- if(${VALGRIND_FOUND} STREQUAL VALGRIND_FOUND-NOTFOUND)
+ if(VALGRIND_FOUND STREQUAL VALGRIND_FOUND-NOTFOUND)
message(WARNING "run_valgrind was TRUE, but valgrind was not found - there will be no tests run under valgrind")
else()
add_test(NAME ${whatIsBuilding}_valgrind COMMAND valgrind --gen-suppressions=all --num-callers=100 --error-exitcode=1 --leak-check=full --track-origins=yes ${VALGRIND_SUPPRESSIONS_FILE_EXTRA_PARAMETER} $<TARGET_FILE:${whatIsBuilding}_exe>)
@@ -546,29 +546,29 @@ function(compile_c_test_artifacts_as whatIsBuilding compileAsWhat)
(("${whatIsBuilding}" MATCHES ".*int.*") AND ${run_int_tests})
)
if (${use_cppunittest})
- if(${compileAsWhat} STREQUAL "C99")
+ if(compileAsWhat STREQUAL "C99")
compileTargetAsC99(${whatIsBuilding}_dll)
compileTargetAsC99(${whatIsBuilding}_testsonly_lib)
endif()
- if(${compileAsWhat} STREQUAL "C11")
+ if(compileAsWhat STREQUAL "C11")
compileTargetAsC11(${whatIsBuilding}_dll)
compileTargetAsC11(${whatIsBuilding}_testsonly_lib)
endif()
endif()
- if(${compileAsWhat} STREQUAL "C99")
+ if(compileAsWhat STREQUAL "C99")
compileTargetAsC99(${whatIsBuilding}_exe)
endif()
- if(${compileAsWhat} STREQUAL "C11")
+ if(compileAsWhat STREQUAL "C11")
compileTargetAsC11(${whatIsBuilding}_exe)
endif()
else()
if(
(("${whatIsBuilding}" MATCHES ".*e2e.*") AND ${nuget_e2e_tests})
)
- if(${compileAsWhat} STREQUAL "C99")
+ if(compileAsWhat STREQUAL "C99")
compileTargetAsC99(${whatIsBuilding}_exe)
endif()
- if(${compileAsWhat} STREQUAL "C11")
+ if(compileAsWhat STREQUAL "C11")
compileTargetAsC11(${whatIsBuilding}_exe)
endif()
else()
@@ -581,10 +581,10 @@ function(compile_c_test_artifacts_as whatIsBuilding compileAsWhat)
(("${whatIsBuilding}" MATCHES ".*e2e.*") AND ${run_e2e_tests}) OR
(("${whatIsBuilding}" MATCHES ".*int.*") AND ${run_int_tests})
)
- if(${compileAsWhat} STREQUAL "C99")
+ if(compileAsWhat STREQUAL "C99")
compileTargetAsC99(${whatIsBuilding}_exe)
endif()
- if(${compileAsWhat} STREQUAL "C11")
+ if(compileAsWhat STREQUAL "C11")
compileTargetAsC11(${whatIsBuilding}_exe)
endif()
endif()
@@ -641,15 +641,15 @@ function(set_platform_files c_shared_dir)
set(CONDITION_C_FILE ${c_shared_dir}/adapters/condition_win32.c PARENT_SCOPE)
endif()
- if(${use_etw} STREQUAL "OFF")
+ if(use_etw STREQUAL "OFF")
set(XLOGGING_C_FILE ${c_shared_dir}/src/xlogging.c PARENT_SCOPE)
set(LOGGING_C_FILE ${c_shared_dir}/src/consolelogger.c PARENT_SCOPE)
set(LOGGING_H_FILE ${c_shared_dir}/inc/azure_c_shared_utility/consolelogger.h PARENT_SCOPE)
- elseif(${use_etw} STREQUAL "TRACELOGGING")
+ elseif(use_etw STREQUAL "TRACELOGGING")
set(XLOGGING_C_FILE ${c_shared_dir}/src/etwxlogging.c PARENT_SCOPE)
set(LOGGING_C_FILE ${c_shared_dir}/src/etwlogger_driver.c PARENT_SCOPE)
set(LOGGING_H_FILE ${c_shared_dir}/inc/azure_c_shared_utility/etwlogger_driver.h PARENT_SCOPE)
- elseif(${use_etw} STREQUAL "TRACELOGGING_WITH_CONSOLE")
+ elseif(use_etw STREQUAL "TRACELOGGING_WITH_CONSOLE")
set(XLOGGING_C_FILE ${c_shared_dir}/src/etwxlogging.c PARENT_SCOPE)
set(LOGGING_C_FILE ${c_shared_dir}/src/etwlogger_driver.c ${c_shared_dir}/src/consolelogger.c PARENT_SCOPE)
set(LOGGING_H_FILE ${c_shared_dir}/inc/azure_c_shared_utility/etwlogger_driver.h ${c_shared_dir}/inc/azure_c_shared_utility/consolelogger.h PARENT_SCOPE)
|