From 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:41:38 +0200 Subject: Adding upstream version 1.0.1. Signed-off-by: Daniel Baumann --- test cases/frameworks/19 pcap/meson.build | 22 ++++++++++++++++++++++ test cases/frameworks/19 pcap/pcap_prog.c | 15 +++++++++++++++ test cases/frameworks/19 pcap/test.json | 3 +++ 3 files changed, 40 insertions(+) create mode 100644 test cases/frameworks/19 pcap/meson.build create mode 100644 test cases/frameworks/19 pcap/pcap_prog.c create mode 100644 test cases/frameworks/19 pcap/test.json (limited to 'test cases/frameworks/19 pcap') diff --git a/test cases/frameworks/19 pcap/meson.build b/test cases/frameworks/19 pcap/meson.build new file mode 100644 index 0000000..051e49e --- /dev/null +++ b/test cases/frameworks/19 pcap/meson.build @@ -0,0 +1,22 @@ +project('pcap test', 'c') + +pcap_dep = dependency('pcap', version : '>=1.0', required: false) + +if not pcap_dep.found() + error('MESON_SKIP_TEST pcap not found.') +endif + +pcap_ver = pcap_dep.version() +assert(pcap_ver.split('.').length() > 1, 'pcap version is "@0@"'.format(pcap_ver)) + +e = executable('pcap_prog', 'pcap_prog.c', dependencies : pcap_dep) + +test('pcaptest', e) + +# Ensure discovery via the configuration tools work also +pcap_dep = dependency('pcap', version : '>=1.0', method : 'pcap-config') +pcap_dep = dependency('pcap', version : '>=1.0', method : 'config-tool') + +# Check we can apply a version constraint +dependency('pcap', version: '>=@0@'.format(pcap_dep.version()), method: 'pkg-config', required: false) +dependency('pcap', version: '>=@0@'.format(pcap_dep.version()), method: 'config-tool') diff --git a/test cases/frameworks/19 pcap/pcap_prog.c b/test cases/frameworks/19 pcap/pcap_prog.c new file mode 100644 index 0000000..0fca16c --- /dev/null +++ b/test cases/frameworks/19 pcap/pcap_prog.c @@ -0,0 +1,15 @@ +#include + +int +main() +{ + char errbuf[PCAP_ERRBUF_SIZE]; +#ifdef __APPLE__ + // source = NULL for "any" doesn't work on macOS (linux only?) + char *source = "en0"; +#else + char *source = NULL; +#endif + pcap_t *p = pcap_create(source, errbuf); + return p == NULL; +} diff --git a/test cases/frameworks/19 pcap/test.json b/test cases/frameworks/19 pcap/test.json new file mode 100644 index 0000000..8ee026a --- /dev/null +++ b/test cases/frameworks/19 pcap/test.json @@ -0,0 +1,3 @@ +{ + "skip_on_jobname": ["azure", "cygwin", "msys2"] +} -- cgit v1.2.3