|
1 | | -############################################################################ |
| 1 | +# ############################################################################## |
2 | 2 | # apps/netutils/mqttc/CMakeLists.txt |
3 | 3 | # |
4 | 4 | # SPDX-License-Identifier: Apache-2.0 |
5 | 5 | # |
6 | | -# Licensed to the Apache Software Foundation (ASF) under one or more |
7 | | -# contributor license agreements. See the NOTICE file distributed with |
8 | | -# this work for additional information regarding copyright ownership. The |
9 | | -# ASF licenses this file to you under the Apache License, Version 2.0 (the |
10 | | -# "License"); you may not use this file except in compliance with the |
11 | | -# License. You may obtain a copy of the License at |
| 6 | +# Licensed to the Apache Software Foundation (ASF) under one or more contributor |
| 7 | +# license agreements. See the NOTICE file distributed with this work for |
| 8 | +# additional information regarding copyright ownership. The ASF licenses this |
| 9 | +# file to you under the Apache License, Version 2.0 (the "License"); you may not |
| 10 | +# use this file except in compliance with the License. You may obtain a copy of |
| 11 | +# the License at |
12 | 12 | # |
13 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +# http://www.apache.org/licenses/LICENSE-2.0 |
14 | 14 | # |
15 | 15 | # Unless required by applicable law or agreed to in writing, software |
16 | 16 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
17 | 17 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
18 | | -# License for the specific language governing permissions and limitations |
19 | | -# under the License. |
| 18 | +# License for the specific language governing permissions and limitations under |
| 19 | +# the License. |
20 | 20 | # |
21 | | -############################################################################ |
| 21 | +# ############################################################################## |
22 | 22 |
|
23 | 23 | if(CONFIG_NETUTILS_MQTTC) |
24 | 24 |
|
@@ -124,4 +124,24 @@ if(CONFIG_NETUTILS_MQTTC) |
124 | 124 | mqttc) |
125 | 125 | endif() |
126 | 126 | endif() |
| 127 | + |
| 128 | + if(CONFIG_NETUTILS_MQTTC_TEST) |
| 129 | + set(MQTT_TEST_CFLAGS ${CFLAGS} -Dopen_nb_socket=test_open_nb_socket |
| 130 | + -Dpublish_callback=test_publish_callback) |
| 131 | + |
| 132 | + nuttx_add_application( |
| 133 | + NAME |
| 134 | + cmocka_mqttc_test |
| 135 | + STACKSIZE |
| 136 | + ${CONFIG_NETUTILS_MQTTC_TEST_STACKSIZE} |
| 137 | + PRIORITY |
| 138 | + ${SCHED_PRIORITY_DEFAULT} |
| 139 | + SRCS |
| 140 | + ${MQTTC_DIR}/tests.c |
| 141 | + COMPILE_FLAGS |
| 142 | + ${MQTT_TEST_CFLAGS} |
| 143 | + DEPENDS |
| 144 | + cmocka |
| 145 | + mqttc) |
| 146 | + endif() |
127 | 147 | endif() |
0 commit comments