From: Collin Funk Date: Thu, 25 Jul 2024 03:27:46 +0000 (-0700) Subject: sys_un: Add C++ tests. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=f9d6d12c37745c2ebd7a8d02d24faced3a5669be;p=gnulib.git sys_un: Add C++ tests. * modules/sys_un-c++-tests: New file. * tests/test-sys_un-c++.cc: New file. * modules/sys_un-tests (Depends-on): Add sys_un-c++-tests. --- diff --git a/ChangeLog b/ChangeLog index 8c93d18bdc..ad0e632c03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2024-07-24 Collin Funk + sys_un: Add C++ tests. + * modules/sys_un-c++-tests: New file. + * tests/test-sys_un-c++.cc: New file. + * modules/sys_un-tests (Depends-on): Add sys_un-c++-tests. + sys_un: Add tests. * modules/sys_un-tests: New file. * tests/test-sys_un.c: New file. diff --git a/modules/sys_un-c++-tests b/modules/sys_un-c++-tests new file mode 100644 index 0000000000..d5aac5183a --- /dev/null +++ b/modules/sys_un-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-sys_un-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-sys_un-c++ +check_PROGRAMS += test-sys_un-c++ +test_sys_un_c___SOURCES = test-sys_un-c++.cc +endif diff --git a/modules/sys_un-tests b/modules/sys_un-tests index a7d912be0c..ef4e81bb82 100644 --- a/modules/sys_un-tests +++ b/modules/sys_un-tests @@ -3,6 +3,7 @@ tests/test-sys_un.c Depends-on: assert-h +sys_un-c++-tests configure.ac: diff --git a/tests/test-sys_un-c++.cc b/tests/test-sys_un-c++.cc new file mode 100644 index 0000000000..5b2e39177a --- /dev/null +++ b/tests/test-sys_un-c++.cc @@ -0,0 +1,44 @@ +/* Test of the substitute in C++ mode. + Copyright (C) 2024 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Collin Funk , 2024. */ + +#define GNULIB_NAMESPACE gnulib +#include + +#if HAVE_UNIXSOCKET + +# include + +int +main () +{ +} + +#else + +/* UNIX domain sockets unsupported. */ + +# include + +int +main () +{ + std::cout << "Skipping test: UNIX domain sockets not supported" << std::endl; + return 77; +} + +#endif