Sat May 7 05:14:10 2022 UTC ()
Bump timeout.


(rin)
diff -r1.3 -r1.4 src/tests/usr.bin/c++/t_call_once2.sh

cvs diff -r1.3 -r1.4 src/tests/usr.bin/c++/t_call_once2.sh (expand / switch to unified diff)

--- src/tests/usr.bin/c++/t_call_once2.sh 2021/09/04 05:47:31 1.3
+++ src/tests/usr.bin/c++/t_call_once2.sh 2022/05/07 05:14:09 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: t_call_once2.sh,v 1.3 2021/09/04 05:47:31 rin Exp $ 1# $NetBSD: t_call_once2.sh,v 1.4 2022/05/07 05:14:09 rin Exp $
2# 2#
3# Copyright (c) 2018 The NetBSD Foundation, Inc. 3# Copyright (c) 2018 The NetBSD Foundation, Inc.
4# All rights reserved. 4# All rights reserved.
5# 5#
6# Redistribution and use in source and binary forms, with or without 6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions 7# modification, are permitted provided that the following conditions
8# are met: 8# are met:
9# 1. Redistributions of source code must retain the above copyright 9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer. 10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright 11# 2. Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the 12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution. 13# documentation and/or other materials provided with the distribution.
14# 14#
@@ -19,80 +19,90 @@ @@ -19,80 +19,90 @@
19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25# POSSIBILITY OF SUCH DAMAGE. 25# POSSIBILITY OF SUCH DAMAGE.
26# 26#
27 27
28atf_test_case call_once2 28atf_test_case call_once2
29call_once2_head() { 29call_once2_head() {
30 atf_set "descr" "compile and run std::call_once" 30 atf_set "descr" "compile and run std::call_once"
31 atf_set "require.progs" "c++" 31 atf_set "require.progs" "c++"
 32 atf_set "timeout" "600"
32} 33}
33 34
34atf_test_case call_once2_profile 35atf_test_case call_once2_profile
35call_once2_profile_head() { 36call_once2_profile_head() {
36 atf_set "descr" "compile and run std::call_once with profiling option" 37 atf_set "descr" "compile and run std::call_once with profiling option"
37 atf_set "require.progs" "c++" 38 atf_set "require.progs" "c++"
 39 atf_set "timeout" "600"
38} 40}
39 41
40atf_test_case call_once2_pic 42atf_test_case call_once2_pic
41call_once2_pic_head() { 43call_once2_pic_head() {
42 atf_set "descr" "compile and run PIC std::call_once" 44 atf_set "descr" "compile and run PIC std::call_once"
43 atf_set "require.progs" "c++" 45 atf_set "require.progs" "c++"
 46 atf_set "timeout" "600"
44} 47}
45 48
46atf_test_case call_once2_pic_32 49atf_test_case call_once2_pic_32
47call_once2_pic_32_head() { 50call_once2_pic_32_head() {
48 atf_set "descr" "compile and run 32-bit PIC std::call_once" 51 atf_set "descr" "compile and run 32-bit PIC std::call_once"
49 atf_set "require.progs" "c++" 52 atf_set "require.progs" "c++"
 53 atf_set "timeout" "600"
50} 54}
51 55
52atf_test_case call_once2_pic_profile 56atf_test_case call_once2_pic_profile
53call_once2_pic_profile_head() { 57call_once2_pic_profile_head() {
54 atf_set "descr" "compile and run PIC std::call_once with profiling flag" 58 atf_set "descr" "compile and run PIC std::call_once with profiling flag"
55 atf_set "require.progs" "c++" 59 atf_set "require.progs" "c++"
 60 atf_set "timeout" "600"
56} 61}
57 62
58atf_test_case call_once2_pic_profile_32 63atf_test_case call_once2_pic_profile_32
59call_once2_pic_profile_32_head() { 64call_once2_pic_profile_32_head() {
60 atf_set "descr" "compile and run 32-bit PIC std::call_once with profiling flag" 65 atf_set "descr" "compile and run 32-bit PIC std::call_once with profiling flag"
61 atf_set "require.progs" "c++" 66 atf_set "require.progs" "c++"
 67 atf_set "timeout" "600"
62} 68}
63 69
64atf_test_case call_once2_profile_32 70atf_test_case call_once2_profile_32
65call_once2_profile_32_head() { 71call_once2_profile_32_head() {
66 atf_set "descr" "compile and run 32-bit std::call_once with profiling flag" 72 atf_set "descr" "compile and run 32-bit std::call_once with profiling flag"
67 atf_set "require.progs" "c++" 73 atf_set "require.progs" "c++"
 74 atf_set "timeout" "600"
68} 75}
69 76
70atf_test_case call_once2_pie 77atf_test_case call_once2_pie
71call_once2_pie_head() { 78call_once2_pie_head() {
72 atf_set "descr" "compile and run position independent (PIE) std::call_once" 79 atf_set "descr" "compile and run position independent (PIE) std::call_once"
73 atf_set "require.progs" "c++" 80 atf_set "require.progs" "c++"
 81 atf_set "timeout" "600"
74} 82}
75 83
76atf_test_case call_once2_32 84atf_test_case call_once2_32
77call_once2_32_head() { 85call_once2_32_head() {
78 atf_set "descr" "compile and run std::call_once for/in netbsd32 emulation" 86 atf_set "descr" "compile and run std::call_once for/in netbsd32 emulation"
79 atf_set "require.progs" "c++ file diff cat" 87 atf_set "require.progs" "c++ file diff cat"
 88 atf_set "timeout" "600"
80} 89}
81 90
82atf_test_case call_once2_static 91atf_test_case call_once2_static
83call_once2_static_head() { 92call_once2_static_head() {
84 atf_set "descr" "compile and run std::call_once with static flag" 93 atf_set "descr" "compile and run std::call_once with static flag"
85 atf_set "require.progs" "c++" 94 atf_set "require.progs" "c++"
 95 atf_set "timeout" "600"
86} 96}
87 97
88call_once2_body() { 98call_once2_body() {
89 cat > test.cpp << EOF 99 cat > test.cpp << EOF
90#include <mutex> 100#include <mutex>
91#include <thread> 101#include <thread>
92#include <iostream> 102#include <iostream>
93std::once_flag flag, flag_throw; 103std::once_flag flag, flag_throw;
94void print_once(void) { std::call_once(flag, [](){ std::cout << "hello, " << std::flush; }); } 104void print_once(void) { std::call_once(flag, [](){ std::cout << "hello, " << std::flush; }); }
95void throw_once(void) { throw std::exception(); } 105void throw_once(void) { throw std::exception(); }
96int main(void) { 106int main(void) {
97 static const int nr_threads(4); 107 static const int nr_threads(4);
98 std::thread threads[nr_threads]; 108 std::thread threads[nr_threads];