sys_utsname: Add C++ tests.
authorBruno Haible <bruno@clisp.org>
Sat, 3 Sep 2022 19:10:07 +0000 (21:10 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 3 Sep 2022 23:17:47 +0000 (01:17 +0200)
* tests/test-sys_utsname-c++.cc: New file.
* modules/sys_utsname-c++-tests: New file.
* modules/sys_utsname-tests (Depends-on): Add sys_utsname-c++-tests.

ChangeLog
modules/sys_utsname-c++-tests [new file with mode: 0644]
modules/sys_utsname-tests
tests/test-sys_utsname-c++.cc [new file with mode: 0644]

index ea2a9d8baa7354471a3cba828cf709ec30acbaff..9bfc6173a190059bbdf23dfef604f4311f1a4a62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-09-03  Bruno Haible  <bruno@clisp.org>
+
+       sys_utsname: Add C++ tests.
+       * tests/test-sys_utsname-c++.cc: New file.
+       * modules/sys_utsname-c++-tests: New file.
+       * modules/sys_utsname-tests (Depends-on): Add sys_utsname-c++-tests.
+
 2022-09-03  Bruno Haible  <bruno@clisp.org>
 
        sys_uio: Add C++ tests.
diff --git a/modules/sys_utsname-c++-tests b/modules/sys_utsname-c++-tests
new file mode 100644 (file)
index 0000000..2f2a1b3
--- /dev/null
@@ -0,0 +1,17 @@
+Files:
+tests/test-sys_utsname-c++.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-sys_utsname-c++
+check_PROGRAMS += test-sys_utsname-c++
+test_sys_utsname_c___SOURCES = test-sys_utsname-c++.cc
+endif
index 8d95351f473f1b5419b8d305e791cd18ee8ee13c..9b958c7a744f2a29bcf075b3f5087b4fa018f6c9 100644 (file)
@@ -2,6 +2,7 @@ Files:
 tests/test-sys_utsname.c
 
 Depends-on:
+sys_utsname-c++-tests
 
 configure.ac:
 
diff --git a/tests/test-sys_utsname-c++.cc b/tests/test-sys_utsname-c++.cc
new file mode 100644 (file)
index 0000000..9bf2080
--- /dev/null
@@ -0,0 +1,28 @@
+/* Test of <sys/utsname.h> substitute in C++ mode.
+   Copyright (C) 2022 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 <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2022.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <sys/utsname.h>
+
+
+int
+main ()
+{
+}