|
| 1 | +# Copyright 2026 Aurora Operations, Inc. |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0 |
| 4 | +# |
| 5 | +# This work is dual licensed. |
| 6 | +# You may use it under Apache-2.0 or GPL-2.0 at your option. |
| 7 | +# |
| 8 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | +# you may not use this file except in compliance with the License. |
| 10 | +# You may obtain a copy of the License at |
| 11 | +# |
| 12 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +# |
| 14 | +# Unless required by applicable law or agreed to in writing, software |
| 15 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | +# See the License for the specific language governing permissions and |
| 18 | +# limitations under the License. |
| 19 | +# |
| 20 | +# OR |
| 21 | +# |
| 22 | +# This program is free software; you can redistribute it and/or |
| 23 | +# modify it under the terms of the GNU General Public License |
| 24 | +# as published by the Free Software Foundation; either version 2 |
| 25 | +# of the License, or (at your option) any later version. |
| 26 | +# |
| 27 | +# This program is distributed in the hope that it will be useful, |
| 28 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 29 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 30 | +# GNU General Public License for more details. |
| 31 | +# |
| 32 | +# You should have received a copy of the GNU General Public License |
| 33 | +# along with this program; if not, see |
| 34 | +# <https://www.gnu.org/licenses/>. |
| 35 | + |
| 36 | +cmake_minimum_required(VERSION 3.22) |
| 37 | + |
| 38 | +project(NAT20TEST VERSION 0.0.1 LANGUAGES C) |
| 39 | + |
| 40 | +# The C standard shall be C11. |
| 41 | +set(CMAKE_C_STANDARD 11) |
| 42 | + |
| 43 | +# CMake shall generate a compile_commands.json file for |
| 44 | +# the benfit of clangd based IDE support. |
| 45 | +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
| 46 | + |
| 47 | + |
| 48 | +################################################################################################### |
| 49 | +# Integration test binary — exercises the nat20 DICE service via /dev/nat200. |
| 50 | +add_executable(nat20_integration_test) |
| 51 | + |
| 52 | +find_package(LibNat20 REQUIRED) |
| 53 | +find_package(OpenSSL REQUIRED) |
| 54 | + |
| 55 | +target_sources(nat20_integration_test |
| 56 | +PRIVATE test/nat20_integration_test.c |
| 57 | +PRIVATE test/test_helpers.c |
| 58 | +) |
| 59 | + |
| 60 | +target_include_directories(nat20_integration_test |
| 61 | + PRIVATE test |
| 62 | +) |
| 63 | + |
| 64 | +target_link_libraries(nat20_integration_test |
| 65 | +PRIVATE LibNat20::nat20 |
| 66 | +PRIVATE LibNat20::nat20_service |
| 67 | +PRIVATE LibNat20::nat20_crypto_nat20 |
| 68 | +PRIVATE OpenSSL::Crypto |
| 69 | +) |
| 70 | + |
| 71 | +target_compile_options(nat20_integration_test |
| 72 | +PRIVATE -pedantic |
| 73 | +PRIVATE -Wall |
| 74 | +PRIVATE -Wextra |
| 75 | +PRIVATE -Werror |
| 76 | +) |
| 77 | + |
| 78 | +install(TARGETS nat20_integration_test RUNTIME DESTINATION bin) |
| 79 | +install(PROGRAMS nat20test.sh DESTINATION bin) |
| 80 | +install(PROGRAMS nat20_qemu_init.sh DESTINATION bin) |
| 81 | + |
| 82 | +################################################################################################### |
0 commit comments