From f54f7d847099db448223fd630c5416b6fbd84c9e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Aug 2017 18:30:33 +0200 Subject: configure: Add a feature to write tests in the .json file We're adding a lot of unnecessary files that end up later as cargo-cult, for at most a handful of lines. So instead move the testcases directly into the .json file. The following sources were not inlined, because multiple tests share them, and the inlining infra does not support that (yet): - avx512 - openssl - gnu-libiconv/sun-libiconv (there is also a command line option to select the exact variant, which makes it hard/impossible to properly coalesce the library sources) The following sources were not inlined because of "complications": - verifyspec contains a lengthy function in the project file - stl contains lots of code in the source file - xlocalescanprint includes a private header from the source tree via a relative path, which we can't do, as the test's physical location is variable. - corewlan uses objective c++, which the inline system doesn't support reduce_relocs and reduce_exports now create libraries with main(), which is weird enough, but doesn't hurt. Done-with: Oswald Buddenhagen Change-Id: Ic3a088f9f08a4fd7ae91fffd14ce8a262021cca0 Reviewed-by: Oswald Buddenhagen --- src/network/configure.json | 58 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 5 deletions(-) (limited to 'src/network/configure.json') diff --git a/src/network/configure.json b/src/network/configure.json index d35dda99bc..c77004d4ba 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -38,7 +38,14 @@ }, "libproxy": { "label": "libproxy", - "test": "common/libproxy", + "test": { + "include": [ "proxy.h" ], + "main": [ + "pxProxyFactory *factory = px_proxy_factory_new();", + "px_proxy_factory_get_proxies(factory, \"http://qt-project.org\");", + "px_proxy_factory_free(factory);" + ] + }, "sources": [ "-lproxy" ] @@ -85,25 +92,66 @@ "getaddrinfo": { "label": "getaddrinfo()", "type": "compile", - "test": "unix/getaddrinfo", + "test": { + "head": [ + "#include ", + "#include ", + "#ifdef __MINGW32__", + "# include ", + "# include ", + "#else", + "# include ", + "# include ", + "# include ", + "#endif" + ], + "main": [ + "addrinfo *res = 0;", + "(void) getaddrinfo(\"foo\", 0, 0, &res);", + "freeaddrinfo(res);", + "gai_strerror(0);" + ] + }, "use": "network" }, "getifaddrs": { "label": "getifaddrs()", "type": "compile", - "test": "unix/getifaddrs", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "net/if.h", "ifaddrs.h" ], + "main": [ + "ifaddrs *list;", + "getifaddrs(&list);", + "freeifaddrs(list);" + ] + }, "use": "network" }, "ipv6ifname": { "label": "IPv6 ifname", "type": "compile", - "test": "unix/ipv6ifname", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "net/if.h" ], + "main": [ + "char buf[IFNAMSIZ];", + "if_nametoindex(\"eth0\");", + "if_indextoname(1, buf);" + ] + }, "use": "network" }, "sctp": { "label": "SCTP support", "type": "compile", - "test": "unix/sctp", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "netinet/in.h", "netinet/sctp.h" ], + "main": [ + "sctp_initmsg sctpInitMsg;", + "socklen_t sctpInitMsgSize = sizeof(sctpInitMsg);", + "(void) socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);", + "(void) getsockopt(-1, SOL_SCTP, SCTP_INITMSG, &sctpInitMsg, &sctpInitMsgSize);" + ] + }, "use": "network" } }, -- cgit v1.2.3 From b0060d1056d6d1752d91652261de97db909c7862 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 12:51:38 +0200 Subject: configure: un-namespace remaining non-inline configure tests only few tests remain, and many of these were mis-classified anyway. Change-Id: Ic3bc96928a0c79fe77b9ec10e6508d4822f18df2 Reviewed-by: Thiago Macieira --- src/network/configure.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/network/configure.json') diff --git a/src/network/configure.json b/src/network/configure.json index c77004d4ba..6e7ce25051 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -25,7 +25,7 @@ "corewlan": { "label": "CoreWLan", "export": "", - "test": "mac/corewlan", + "test": "corewlan", "sources": [ "-framework CoreWLAN -framework Foundation" ] @@ -53,7 +53,7 @@ "openssl_headers": { "label": "OpenSSL Headers", "export": "openssl", - "test": "unix/openssl", + "test": "openssl", "sources": [ { "comment": "placeholder for OPENSSL_PATH", @@ -63,7 +63,7 @@ }, "openssl": { "label": "OpenSSL", - "test": "unix/openssl", + "test": "openssl", "sources": [ { "type": "openssl" }, { -- cgit v1.2.3