]> Savannah Git Hosting - gnulib.git/commitdiff
sched: Add C++ tests.
authorBruno Haible <bruno@clisp.org>
Sat, 3 Sep 2022 18:39:11 +0000 (20:39 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 3 Sep 2022 23:17:42 +0000 (01:17 +0200)
* tests/test-sched-c++.cc: New file.
* modules/sched-c++-tests: New file.
* modules/sched-tests (Depends-on): Add sched-c++-tests.

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

index 787971efabd586d931391a15e15626f92d418adb..2ac7ffd2e9cc2cb112d380db2a2a2944a6079a73 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-09-03  Bruno Haible  <bruno@clisp.org>
+
+       sched: Add C++ tests.
+       * tests/test-sched-c++.cc: New file.
+       * modules/sched-c++-tests: New file.
+       * modules/sched-tests (Depends-on): Add sched-c++-tests.
+
 2022-09-03  Bruno Haible  <bruno@clisp.org>
 
        netinet_in: Add C++ tests.
diff --git a/modules/sched-c++-tests b/modules/sched-c++-tests
new file mode 100644 (file)
index 0000000..28c6ea1
--- /dev/null
@@ -0,0 +1,19 @@
+Files:
+tests/test-sched-c++.cc
+tests/signature.h
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-sched-c++
+check_PROGRAMS += test-sched-c++
+test_sched_c___SOURCES = test-sched-c++.cc
+test_sched_c___LDADD = $(LDADD) $(LIB_SCHED_YIELD)
+endif
index 8427490f57f09212cf96fa1b5d133458ae73e805..52eed8bc25cb5845a42c0cff8b61996f42e8f41f 100644 (file)
@@ -2,6 +2,7 @@ Files:
 tests/test-sched.c
 
 Depends-on:
+sched-c++-tests
 
 configure.ac:
 
diff --git a/tests/test-sched-c++.cc b/tests/test-sched-c++.cc
new file mode 100644 (file)
index 0000000..7ba8aaa
--- /dev/null
@@ -0,0 +1,35 @@
+/* Test of <sched.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 <sched.h>
+
+#include "signature.h"
+
+
+#if GNULIB_TEST_SCHED_YIELD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::sched_yield, int, (void));
+#endif
+
+
+int
+main ()
+{
+}