Use newlines more consistently in generate compile-test code

The generated code contained many repeated blank lines.
Most main()s were preceded by one, but not all.
Only include blank lines for actual empty entries in lists, where
configure.json specified them, plus one before main if anything else
precedes it.

Change-Id: I6e6c34940e08712a1aa848a3c9ad1b0fb5806d77
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Edward Welbourne 2021-02-12 16:40:33 +01:00
parent c462793d67
commit 18bf641777
9 changed files with 126 additions and 232 deletions

View File

@ -27,11 +27,9 @@ qt_config_compile_test(cxx14
# error __cplusplus must be > 201103L (the value of C++11)
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -51,7 +49,6 @@ qt_config_compile_test(cxx17
#include <map> // https://bugs.llvm.org//show_bug.cgi?id=33117
#include <variant>
int main(void)
{
/* BEGIN TEST: */
@ -75,11 +72,9 @@ qt_config_compile_test(cxx20
# error __cplusplus must be > 201703L (the value for C++17)
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -91,15 +86,13 @@ int main(void)
qt_config_compile_test(precompile_header
LABEL "precompiled header support"
CODE
"
#ifndef HEADER_H
"#ifndef HEADER_H
#error no go
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -144,11 +137,9 @@ qt_config_compile_test(reduce_relocations
# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -166,7 +157,6 @@ qt_config_compile_test(signaling_nan
CODE
"#include <limits>
int main(void)
{
/* BEGIN TEST: */
@ -244,8 +234,7 @@ qt_config_compile_test_x86simd(avx512vbmi "AVX512 VBMI instructions")
qt_config_compile_test(posix_fallocate
LABEL "POSIX fallocate()"
CODE
"
#include <fcntl.h>
"#include <fcntl.h>
#include <unistd.h>
int main(void)
@ -261,8 +250,7 @@ int main(void)
qt_config_compile_test(alloca_stdlib_h
LABEL "alloca() in stdlib.h"
CODE
"
#include <stdlib.h>
"#include <stdlib.h>
int main(void)
{
@ -277,12 +265,12 @@ alloca(1);
qt_config_compile_test(alloca_h
LABEL "alloca() in alloca.h"
CODE
"
#include <alloca.h>
"#include <alloca.h>
#ifdef __QNXNTO__
// extra include needed in QNX7 to define NULL for the alloca() macro
# include <stddef.h>
#endif
int main(void)
{
/* BEGIN TEST: */
@ -296,8 +284,7 @@ alloca(1);
qt_config_compile_test(alloca_malloc_h
LABEL "alloca() in malloc.h"
CODE
"
#include <malloc.h>
"#include <malloc.h>
int main(void)
{
@ -320,11 +307,9 @@ qt_config_compile_test(stack_protector
# endif
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -334,10 +319,7 @@ int main(void)
qt_config_compile_test(intelcet
LABEL "Support for Intel Control-flow Enforcement Technology"
CODE
"
int main(void)
"int main(void)
{
/* BEGIN TEST: */
#if !defined(__CET__)

View File

@ -27,11 +27,9 @@ qt_config_compile_test(cxx14
# error __cplusplus must be > 201103L (the value of C++11)
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -51,7 +49,6 @@ qt_config_compile_test(cxx17
#include <map> // https://bugs.llvm.org//show_bug.cgi?id=33117
#include <variant>
int main(void)
{
/* BEGIN TEST: */
@ -75,11 +72,9 @@ qt_config_compile_test(cxx20
# error __cplusplus must be > 201703L (the value for C++17)
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -91,15 +86,13 @@ int main(void)
qt_config_compile_test(precompile_header
LABEL "precompiled header support"
CODE
"
#ifndef HEADER_H
"#ifndef HEADER_H
#error no go
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -144,11 +137,9 @@ qt_config_compile_test(reduce_relocations
# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -166,7 +157,6 @@ qt_config_compile_test(signaling_nan
CODE
"#include <limits>
int main(void)
{
/* BEGIN TEST: */
@ -244,8 +234,7 @@ qt_config_compile_test_x86simd(avx512vbmi "AVX512 VBMI instructions")
qt_config_compile_test(posix_fallocate
LABEL "POSIX fallocate()"
CODE
"
#include <fcntl.h>
"#include <fcntl.h>
#include <unistd.h>
int main(void)
@ -261,8 +250,7 @@ int main(void)
qt_config_compile_test(alloca_stdlib_h
LABEL "alloca() in stdlib.h"
CODE
"
#include <stdlib.h>
"#include <stdlib.h>
int main(void)
{
@ -277,12 +265,12 @@ alloca(1);
qt_config_compile_test(alloca_h
LABEL "alloca() in alloca.h"
CODE
"
#include <alloca.h>
"#include <alloca.h>
#ifdef __QNXNTO__
// extra include needed in QNX7 to define NULL for the alloca() macro
# include <stddef.h>
#endif
int main(void)
{
/* BEGIN TEST: */
@ -296,8 +284,7 @@ alloca(1);
qt_config_compile_test(alloca_malloc_h
LABEL "alloca() in malloc.h"
CODE
"
#include <malloc.h>
"#include <malloc.h>
int main(void)
{
@ -320,11 +307,9 @@ qt_config_compile_test(stack_protector
# endif
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -334,10 +319,7 @@ int main(void)
qt_config_compile_test(intelcet
LABEL "Support for Intel Control-flow Enforcement Technology"
CODE
"
int main(void)
"int main(void)
{
/* BEGIN TEST: */
#if !defined(__CET__)

View File

@ -40,8 +40,7 @@ qt_find_package(Slog2 PROVIDED_TARGETS Slog2::Slog2 MODULE_NAME core QMAKE_LIB s
qt_config_compile_test(atomicfptr
LABEL "working std::atomic for function pointers"
CODE
"
#include <atomic>
"#include <atomic>
typedef void (*fptr)(int);
typedef std::atomic<fptr> atomicfptr;
void testfunction(int) { }
@ -55,6 +54,7 @@ void test(volatile atomicfptr &a)
}
a.store(&testfunction, std::memory_order_release);
}
int main(void)
{
/* BEGIN TEST: */
@ -71,8 +71,7 @@ qt_config_compile_test(clock_monotonic
LIBRARIES
WrapRt::WrapRt
CODE
"
#include <unistd.h>
"#include <unistd.h>
#include <time.h>
int main(void)
@ -120,8 +119,7 @@ int pipes[2];
qt_config_compile_test(cxx11_future
LABEL "C++11 <future>"
CODE
"
#include <future>
"#include <future>
int main(void)
{
@ -138,8 +136,7 @@ std::future<int> f = std::async([]() { return 42; });
qt_config_compile_test(cxx11_random
LABEL "C++11 <random>"
CODE
"
#include <random>
"#include <random>
int main(void)
{
@ -154,8 +151,7 @@ std::mt19937 mt(0);
qt_config_compile_test(cxx17_filesystem
LABEL "C++17 <filesystem>"
CODE
"
#include <filesystem>
"#include <filesystem>
int main(void)
{
@ -173,8 +169,7 @@ std::filesystem::copy(
qt_config_compile_test(eventfd
LABEL "eventfd"
CODE
"
#include <sys/eventfd.h>
"#include <sys/eventfd.h>
int main(void)
{
@ -192,8 +187,7 @@ eventfd_write(fd, value);
qt_config_compile_test(futimens
LABEL "futimens()"
CODE
"
#include <sys/stat.h>
"#include <sys/stat.h>
int main(void)
{
@ -209,8 +203,7 @@ futimens(-1, 0);
qt_config_compile_test(futimes
LABEL "futimes()"
CODE
"
#include <sys/time.h>
"#include <sys/time.h>
int main(void)
{
@ -225,8 +218,7 @@ futimes(-1, 0);
qt_config_compile_test(getauxval
LABEL "getauxval()"
CODE
"
#include <sys/auxv.h>
"#include <sys/auxv.h>
int main(void)
{
@ -241,8 +233,7 @@ int main(void)
qt_config_compile_test(getentropy
LABEL "getentropy()"
CODE
"
#include <unistd.h>
"#include <unistd.h>
int main(void)
{
@ -258,8 +249,7 @@ char buf[32];
qt_config_compile_test(glibc
LABEL "GNU libc"
CODE
"
#include <stdlib.h>
"#include <stdlib.h>
int main(void)
{
@ -274,8 +264,7 @@ return __GLIBC__;
qt_config_compile_test(inotify
LABEL "inotify"
CODE
"
#include <sys/inotify.h>
"#include <sys/inotify.h>
int main(void)
{
@ -292,8 +281,7 @@ inotify_rm_watch(0, 1);
qt_config_compile_test(ipc_sysv
LABEL "SysV IPC"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
@ -320,8 +308,7 @@ qt_config_compile_test(ipc_posix
LIBRARIES
"${ipc_posix_TEST_LIBRARIES}"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/mman.h>
#include <semaphore.h>
#include <fcntl.h>
@ -358,8 +345,7 @@ linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW);
qt_config_compile_test(ppoll
LABEL "ppoll()"
CODE
"
#include <signal.h>
"#include <signal.h>
#include <poll.h>
int main(void)
@ -378,8 +364,7 @@ ppoll(&pfd, 1, &ts, &sig);
qt_config_compile_test(pollts
LABEL "pollts()"
CODE
"
#include <poll.h>
"#include <poll.h>
#include <signal.h>
#include <time.h>
@ -399,8 +384,7 @@ pollts(&pfd, 1, &ts, &sig);
qt_config_compile_test(poll
LABEL "poll()"
CODE
"
#include <poll.h>
"#include <poll.h>
int main(void)
{
@ -454,8 +438,7 @@ return statx(AT_FDCWD, \"\", AT_STATX_SYNC_AS_STAT, mask, &statxbuf);
qt_config_compile_test(syslog
LABEL "syslog"
CODE
"
#include <syslog.h>
"#include <syslog.h>
int main(void)
{
@ -472,9 +455,7 @@ closelog();
qt_config_compile_test(xlocalescanprint
LABEL "xlocale.h (or equivalents)"
CODE
"
#define QT_BEGIN_NAMESPACE
"#define QT_BEGIN_NAMESPACE
#define QT_END_NAMESPACE
#ifdef _MSVC_VER
@ -484,6 +465,7 @@ qt_config_compile_test(xlocalescanprint
#define QT_NO_DOUBLECONVERSION
#include QDSP_P_H
int main(void)
{
/* BEGIN TEST: */

View File

@ -40,8 +40,7 @@ qt_find_package(Slog2 PROVIDED_TARGETS Slog2::Slog2 MODULE_NAME core QMAKE_LIB s
qt_config_compile_test(atomicfptr
LABEL "working std::atomic for function pointers"
CODE
"
#include <atomic>
"#include <atomic>
typedef void (*fptr)(int);
typedef std::atomic<fptr> atomicfptr;
void testfunction(int) { }
@ -55,6 +54,7 @@ void test(volatile atomicfptr &a)
}
a.store(&testfunction, std::memory_order_release);
}
int main(void)
{
/* BEGIN TEST: */
@ -71,8 +71,7 @@ qt_config_compile_test(clock_monotonic
LIBRARIES
WrapRt::WrapRt
CODE
"
#include <unistd.h>
"#include <unistd.h>
#include <time.h>
int main(void)
@ -126,8 +125,7 @@ qt_config_compile_test(cxx11_future
LIBRARIES
"${cxx11_future_TEST_LIBRARIES}"
CODE
"
#include <future>
"#include <future>
int main(void)
{
@ -144,8 +142,7 @@ std::future<int> f = std::async([]() { return 42; });
qt_config_compile_test(cxx11_random
LABEL "C++11 <random>"
CODE
"
#include <random>
"#include <random>
int main(void)
{
@ -160,8 +157,7 @@ std::mt19937 mt(0);
qt_config_compile_test(cxx17_filesystem
LABEL "C++17 <filesystem>"
CODE
"
#include <filesystem>
"#include <filesystem>
int main(void)
{
@ -179,8 +175,7 @@ std::filesystem::copy(
qt_config_compile_test(eventfd
LABEL "eventfd"
CODE
"
#include <sys/eventfd.h>
"#include <sys/eventfd.h>
int main(void)
{
@ -198,8 +193,7 @@ eventfd_write(fd, value);
qt_config_compile_test(futimens
LABEL "futimens()"
CODE
"
#include <sys/stat.h>
"#include <sys/stat.h>
int main(void)
{
@ -215,8 +209,7 @@ futimens(-1, 0);
qt_config_compile_test(futimes
LABEL "futimes()"
CODE
"
#include <sys/time.h>
"#include <sys/time.h>
int main(void)
{
@ -231,8 +224,7 @@ futimes(-1, 0);
qt_config_compile_test(getauxval
LABEL "getauxval()"
CODE
"
#include <sys/auxv.h>
"#include <sys/auxv.h>
int main(void)
{
@ -247,8 +239,7 @@ int main(void)
qt_config_compile_test(getentropy
LABEL "getentropy()"
CODE
"
#include <unistd.h>
"#include <unistd.h>
int main(void)
{
@ -264,8 +255,7 @@ char buf[32];
qt_config_compile_test(glibc
LABEL "GNU libc"
CODE
"
#include <stdlib.h>
"#include <stdlib.h>
int main(void)
{
@ -280,8 +270,7 @@ return __GLIBC__;
qt_config_compile_test(inotify
LABEL "inotify"
CODE
"
#include <sys/inotify.h>
"#include <sys/inotify.h>
int main(void)
{
@ -298,8 +287,7 @@ inotify_rm_watch(0, 1);
qt_config_compile_test(ipc_sysv
LABEL "SysV IPC"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
@ -326,8 +314,7 @@ qt_config_compile_test(ipc_posix
LIBRARIES
"${ipc_posix_TEST_LIBRARIES}"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/mman.h>
#include <semaphore.h>
#include <fcntl.h>
@ -364,8 +351,7 @@ linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW);
qt_config_compile_test(ppoll
LABEL "ppoll()"
CODE
"
#include <signal.h>
"#include <signal.h>
#include <poll.h>
int main(void)
@ -384,8 +370,7 @@ ppoll(&pfd, 1, &ts, &sig);
qt_config_compile_test(pollts
LABEL "pollts()"
CODE
"
#include <poll.h>
"#include <poll.h>
#include <signal.h>
#include <time.h>
@ -405,8 +390,7 @@ pollts(&pfd, 1, &ts, &sig);
qt_config_compile_test(poll
LABEL "poll()"
CODE
"
#include <poll.h>
"#include <poll.h>
int main(void)
{
@ -460,8 +444,7 @@ return statx(AT_FDCWD, \"\", AT_STATX_SYNC_AS_STAT, mask, &statxbuf);
qt_config_compile_test(syslog
LABEL "syslog"
CODE
"
#include <syslog.h>
"#include <syslog.h>
int main(void)
{
@ -478,9 +461,7 @@ closelog();
qt_config_compile_test(xlocalescanprint
LABEL "xlocale.h (or equivalents)"
CODE
"
#define QT_BEGIN_NAMESPACE
"#define QT_BEGIN_NAMESPACE
#define QT_END_NAMESPACE
#ifdef _MSVC_VER
@ -490,6 +471,7 @@ qt_config_compile_test(xlocalescanprint
#define QT_NO_DOUBLECONVERSION
#include QDSP_P_H
int main(void)
{
/* BEGIN TEST: */

View File

@ -144,6 +144,7 @@ extern \"C\" {
#include <xf86drmMode.h>
#include <xf86drm.h>
}
int main(void)
{
/* BEGIN TEST: */
@ -188,8 +189,7 @@ qt_config_compile_test(egl_brcm
LIBRARIES
EGL::EGL
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
#include <bcm_host.h>
int main(void)
@ -208,8 +208,7 @@ qt_config_compile_test(egl_egldevice
LIBRARIES
EGL::EGL
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
#include <EGL/eglext.h>
int main(void)
@ -230,8 +229,7 @@ qt_config_compile_test(egl_mali
LIBRARIES
EGL::EGL
CODE
"
#include <EGL/fbdev_window.h>
"#include <EGL/fbdev_window.h>
#include <EGL/egl.h>
#include <GLES2/gl2.h>
@ -250,8 +248,7 @@ qt_config_compile_test(egl_mali_2
LIBRARIES
EGL::EGL
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
#include <GLES2/gl2.h>
int main(void)
@ -269,8 +266,7 @@ qt_config_compile_test(egl_viv
LIBRARIES
EGL::EGL
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
#include <EGL/eglvivante.h>
int main(void)
@ -295,8 +291,7 @@ qt_config_compile_test(egl_openwfd
LIBRARIES
EGL::EGL
CODE
"
#include <wfd.h>
"#include <wfd.h>
int main(void)
{
@ -314,11 +309,11 @@ qt_config_compile_test(egl_rcar
EGL::EGL
GLESv2::GLESv2
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
extern \"C\" {
extern unsigned long PVRGrfxServerInit(void);
}
int main(void)
{
/* BEGIN TEST: */
@ -345,7 +340,6 @@ enum {
e4 = SYN_REPORT,
};
int main(void)
{
/* BEGIN TEST: */
@ -360,8 +354,7 @@ input_event buf[32];
qt_config_compile_test(integrityfb
LABEL "INTEGRITY framebuffer"
CODE
"
#include <device/fbdriver.h>
"#include <device/fbdriver.h>
int main(void)
{
@ -376,8 +369,7 @@ FBDriver *driver = 0;
qt_config_compile_test(linuxfb
LABEL "LinuxFB"
CODE
"
#include <linux/fb.h>
"#include <linux/fb.h>
#include <sys/kd.h>
#include <sys/ioctl.h>
@ -407,7 +399,6 @@ qt_config_compile_test(opengles3
# include <GLES3/gl3.h>
#endif
int main(void)
{
/* BEGIN TEST: */
@ -427,8 +418,7 @@ qt_config_compile_test(opengles31
LIBRARIES
GLESv2::GLESv2
CODE
"
#include <GLES3/gl31.h>
"#include <GLES3/gl31.h>
int main(void)
{
@ -446,8 +436,7 @@ qt_config_compile_test(opengles32
LIBRARIES
GLESv2::GLESv2
CODE
"
#include <GLES3/gl32.h>
"#include <GLES3/gl32.h>
int main(void)
{
@ -490,6 +479,7 @@ qt_config_compile_test(xcb_syslibs
#include <xcb/xcb_renderutil.h>
#include <xcb/xkb.h>
#undef explicit
int main(void)
{
/* BEGIN TEST: */

View File

@ -144,6 +144,7 @@ extern \"C\" {
#include <xf86drmMode.h>
#include <xf86drm.h>
}
int main(void)
{
/* BEGIN TEST: */
@ -188,8 +189,7 @@ qt_config_compile_test(egl_brcm
LIBRARIES
EGL::EGL
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
#include <bcm_host.h>
int main(void)
@ -208,8 +208,7 @@ qt_config_compile_test(egl_egldevice
LIBRARIES
EGL::EGL
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
#include <EGL/eglext.h>
int main(void)
@ -230,8 +229,7 @@ qt_config_compile_test(egl_mali
LIBRARIES
EGL::EGL
CODE
"
#include <EGL/fbdev_window.h>
"#include <EGL/fbdev_window.h>
#include <EGL/egl.h>
#include <GLES2/gl2.h>
@ -250,8 +248,7 @@ qt_config_compile_test(egl_mali_2
LIBRARIES
EGL::EGL
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
#include <GLES2/gl2.h>
int main(void)
@ -271,8 +268,7 @@ qt_config_compile_test(egl_viv
COMPILE_OPTIONS # special case
"-DEGL_API_FB=1" # special case
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
#include <EGL/eglvivante.h>
int main(void)
@ -297,8 +293,7 @@ qt_config_compile_test(egl_openwfd
LIBRARIES
EGL::EGL
CODE
"
#include <wfd.h>
"#include <wfd.h>
int main(void)
{
@ -316,11 +311,11 @@ qt_config_compile_test(egl_rcar
EGL::EGL
GLESv2::GLESv2
CODE
"
#include <EGL/egl.h>
"#include <EGL/egl.h>
extern \"C\" {
extern unsigned long PVRGrfxServerInit(void);
}
int main(void)
{
/* BEGIN TEST: */
@ -347,7 +342,6 @@ enum {
e4 = SYN_REPORT,
};
int main(void)
{
/* BEGIN TEST: */
@ -362,8 +356,7 @@ input_event buf[32];
qt_config_compile_test(integrityfb
LABEL "INTEGRITY framebuffer"
CODE
"
#include <device/fbdriver.h>
"#include <device/fbdriver.h>
int main(void)
{
@ -378,8 +371,7 @@ FBDriver *driver = 0;
qt_config_compile_test(linuxfb
LABEL "LinuxFB"
CODE
"
#include <linux/fb.h>
"#include <linux/fb.h>
#include <sys/kd.h>
#include <sys/ioctl.h>
@ -409,7 +401,6 @@ qt_config_compile_test(opengles3
# include <GLES3/gl3.h>
#endif
int main(void)
{
/* BEGIN TEST: */
@ -429,8 +420,7 @@ qt_config_compile_test(opengles31
LIBRARIES
GLESv2::GLESv2
CODE
"
#include <GLES3/gl31.h>
"#include <GLES3/gl31.h>
int main(void)
{
@ -448,8 +438,7 @@ qt_config_compile_test(opengles32
LIBRARIES
GLESv2::GLESv2
CODE
"
#include <GLES3/gl32.h>
"#include <GLES3/gl32.h>
int main(void)
{
@ -492,6 +481,7 @@ qt_config_compile_test(xcb_syslibs
#include <xcb/xcb_renderutil.h>
#include <xcb/xkb.h>
#undef explicit
int main(void)
{
/* BEGIN TEST: */

View File

@ -14,8 +14,7 @@ qt_config_compile_test(openssl_headers
LIBRARIES
WrapOpenSSLHeaders::WrapOpenSSLHeaders
CODE
"
#include <openssl/ssl.h>
"#include <openssl/ssl.h>
#include <openssl/opensslv.h>
#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10101000L
# error OpenSSL >= 1.1.1 is required
@ -23,10 +22,10 @@ qt_config_compile_test(openssl_headers
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -38,8 +37,7 @@ qt_config_compile_test(openssl
LIBRARIES
WrapOpenSSL::WrapOpenSSL
CODE
"
#include <openssl/ssl.h>
"#include <openssl/ssl.h>
#include <openssl/opensslv.h>
#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10101000L
# error OpenSSL >= 1.1.1 is required
@ -47,6 +45,7 @@ qt_config_compile_test(openssl
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif
int main(void)
{
/* BEGIN TEST: */
@ -65,8 +64,7 @@ qt_find_package(GSSAPI PROVIDED_TARGETS GSSAPI::GSSAPI MODULE_NAME network QMAKE
qt_config_compile_test(getifaddrs
LABEL "getifaddrs()"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <ifaddrs.h>
@ -87,8 +85,7 @@ freeifaddrs(list);
qt_config_compile_test(ipv6ifname
LABEL "IPv6 ifname"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
@ -109,8 +106,7 @@ if_freenameindex(if_nameindex());
qt_config_compile_test(linux_netlink
LABEL "Linux AF_NETLINK sockets"
CODE
"
#include <asm/types.h>
"#include <asm/types.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <sys/socket.h>
@ -136,8 +132,7 @@ ci.ifa_prefered = ci.ifa_valid = 0;
qt_config_compile_test(sctp
LABEL "SCTP support"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>
@ -161,15 +156,14 @@ qt_config_compile_test(dtls
LIBRARIES
WrapOpenSSLHeaders::WrapOpenSSLHeaders
CODE
"
#include <openssl/ssl.h>
"#include <openssl/ssl.h>
#if defined(OPENSSL_NO_DTLS) || !defined(DTLS1_2_VERSION)
# error OpenSSL without DTLS support
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -181,16 +175,15 @@ qt_config_compile_test(ocsp
LIBRARIES
WrapOpenSSLHeaders::WrapOpenSSLHeaders
CODE
"
#include <openssl/ssl.h>
"#include <openssl/ssl.h>
#include <openssl/ocsp.h>
#if defined(OPENSSL_NO_OCSP) || defined(OPENSSL_NO_TLSEXT)
# error OpenSSL without OCSP stapling
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -200,8 +193,7 @@ int main(void)
qt_config_compile_test(networklistmanager
LABEL "Network List Manager"
CODE
"
#include <netlistmgr.h>
"#include <netlistmgr.h>
#include <wrl/client.h>
int main(void)

View File

@ -14,8 +14,7 @@ qt_config_compile_test(openssl_headers
LIBRARIES
WrapOpenSSLHeaders::WrapOpenSSLHeaders
CODE
"
#include <openssl/ssl.h>
"#include <openssl/ssl.h>
#include <openssl/opensslv.h>
#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10101000L
# error OpenSSL >= 1.1.1 is required
@ -23,10 +22,10 @@ qt_config_compile_test(openssl_headers
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -38,8 +37,7 @@ qt_config_compile_test(openssl
LIBRARIES
WrapOpenSSL::WrapOpenSSL
CODE
"
#include <openssl/ssl.h>
"#include <openssl/ssl.h>
#include <openssl/opensslv.h>
#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10101000L
# error OpenSSL >= 1.1.1 is required
@ -47,6 +45,7 @@ qt_config_compile_test(openssl
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif
int main(void)
{
/* BEGIN TEST: */
@ -65,8 +64,7 @@ qt_find_package(GSSAPI PROVIDED_TARGETS GSSAPI::GSSAPI MODULE_NAME network QMAKE
qt_config_compile_test(getifaddrs
LABEL "getifaddrs()"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <ifaddrs.h>
@ -87,8 +85,7 @@ freeifaddrs(list);
qt_config_compile_test(ipv6ifname
LABEL "IPv6 ifname"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
@ -109,8 +106,7 @@ if_freenameindex(if_nameindex());
qt_config_compile_test(linux_netlink
LABEL "Linux AF_NETLINK sockets"
CODE
"
#include <asm/types.h>
"#include <asm/types.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <sys/socket.h>
@ -136,8 +132,7 @@ ci.ifa_prefered = ci.ifa_valid = 0;
qt_config_compile_test(sctp
LABEL "SCTP support"
CODE
"
#include <sys/types.h>
"#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>
@ -161,15 +156,14 @@ qt_config_compile_test(dtls
LIBRARIES
WrapOpenSSLHeaders::WrapOpenSSLHeaders
CODE
"
#include <openssl/ssl.h>
"#include <openssl/ssl.h>
#if defined(OPENSSL_NO_DTLS) || !defined(DTLS1_2_VERSION)
# error OpenSSL without DTLS support
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -181,16 +175,15 @@ qt_config_compile_test(ocsp
LIBRARIES
WrapOpenSSLHeaders::WrapOpenSSLHeaders
CODE
"
#include <openssl/ssl.h>
"#include <openssl/ssl.h>
#include <openssl/ocsp.h>
#if defined(OPENSSL_NO_OCSP) || defined(OPENSSL_NO_TLSEXT)
# error OpenSSL without OCSP stapling
#endif
int main(void)
{
/* BEGIN TEST: */
/* END TEST: */
return 0;
}
@ -200,8 +193,7 @@ int main(void)
qt_config_compile_test(networklistmanager
LABEL "Network List Manager"
CODE
"
#include <netlistmgr.h>
"#include <netlistmgr.h>
#include <wrl/client.h>
int main(void)

View File

@ -608,24 +608,24 @@ def write_compile_test(
return
def resolve_head(detail):
head = detail.get("head", "")
head = detail.get("head")
if isinstance(head, list):
head = "\n".join(head)
return head
return head + '\n' if head else ''
head = ""
if inherit_details:
head += resolve_head(inherit_details)
head += resolve_head(details)
sourceCode = head + "\n"
sourceCode = head
def resolve_include(detail, keyword):
include = detail.get(keyword, "")
if isinstance(include, list):
include = "#include <" + ">\n#include <".join(include) + ">"
include = "#include <" + ">\n#include <".join(include) + ">\n"
elif include:
include = f"#include <{include}>"
include = f"#include <{include}>\n"
return include
include = ""
@ -640,37 +640,39 @@ def write_compile_test(
include += resolve_include(inherit_details, "include")
include += resolve_include(details, "include")
sourceCode += include + "\n"
sourceCode += include
def resolve_tail(detail):
tail = detail.get("tail", "")
tail = detail.get("tail")
if isinstance(tail, list):
tail = "\n".join(tail)
return tail
return tail + '\n' if tail else ''
tail = ""
if inherit_details:
tail += resolve_tail(inherit_details)
tail += resolve_tail(details)
sourceCode += tail + "\n"
sourceCode += tail
if sourceCode: # blank line before main
sourceCode += '\n'
sourceCode += "int main(void)\n"
sourceCode += "{\n"
sourceCode += " /* BEGIN TEST: */\n"
def resolve_main(detail):
main = detail.get("main", "")
main = detail.get("main")
if isinstance(main, list):
main = "\n".join(main)
return main
return main + '\n' if main else ''
main = ""
if inherit_details:
main += resolve_main(inherit_details)
main += resolve_main(details)
sourceCode += main + "\n"
sourceCode += main
sourceCode += " /* END TEST: */\n"
sourceCode += " return 0;\n"