]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
pthread-h: Add C++ tests.
authorBruno Haible <bruno@clisp.org>
Mon, 15 Jul 2019 00:36:19 +0000 (02:36 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 15 Jul 2019 00:36:19 +0000 (02:36 +0200)
* tests/test-pthread-c++.cc: New file.
* modules/pthread-h-c++-tests: New file.

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

index 3932992e558a3919a932672ea79d2c66c0ec9ff3..2bdf7d61d44c77d621493a123292f1c8405892b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-07-14  Bruno Haible  <bruno@clisp.org>
+
+       pthread-h: Add C++ tests.
+       * tests/test-pthread-c++.cc: New file.
+       * modules/pthread-h-c++-tests: New file.
+
 2019-07-14  Bruno Haible  <bruno@clisp.org>
 
        pthread-h: Add tests.
diff --git a/modules/pthread-h-c++-tests b/modules/pthread-h-c++-tests
new file mode 100644 (file)
index 0000000..1886b0a
--- /dev/null
@@ -0,0 +1,19 @@
+Files:
+tests/test-pthread-c++.cc
+tests/signature.h
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-pthread-c++
+check_PROGRAMS += test-pthread-c++
+test_pthread_c___SOURCES = test-pthread-c++.cc
+test_pthread_c___LDADD = $(LDADD) $(LIB_PTHREAD)
+endif
diff --git a/tests/test-pthread-c++.cc b/tests/test-pthread-c++.cc
new file mode 100644 (file)
index 0000000..dff13f8
--- /dev/null
@@ -0,0 +1,36 @@
+/* Test of <pthread.h> substitute in C++ mode.
+   Copyright (C) 2019 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>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <pthread.h>
+
+#include "signature.h"
+
+
+#if GNULIB_TEST_PTHREAD_MUTEX_TIMEDLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_timedlock, int,
+                 (pthread_mutex_t *, const struct timespec *));
+#endif
+
+
+int
+main ()
+{
+}