File tree 4 files changed +53
-0
lines changed
4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ name = "errqueue"
71
71
path = " test/errqueue.rs"
72
72
harness = true
73
73
74
+ [[test ]]
75
+ name = " sigrt"
76
+ path = " test/sigrt.rs"
77
+ harness = true
78
+
74
79
[[test ]]
75
80
name = " semver"
76
81
path = " test/semver.rs"
Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ fn do_cc() {
26
26
if target. contains ( "android" ) || target. contains ( "linux" ) {
27
27
cc:: Build :: new ( ) . file ( "src/errqueue.c" ) . compile ( "errqueue" ) ;
28
28
}
29
+ if target. contains ( "linux" )
30
+ || target. contains ( "l4re" )
31
+ || target. contains ( "android" )
32
+ || target. contains ( "emscripten" )
33
+ {
34
+ cc:: Build :: new ( ) . file ( "src/sigrt.c" ) . compile ( "sigrt" ) ;
35
+ }
29
36
}
30
37
31
38
fn do_ctest ( ) {
Original file line number Diff line number Diff line change
1
+ #include <signal.h>
2
+
3
+ int sigrtmax () {
4
+ return SIGRTMAX ;
5
+ }
6
+
7
+ int sigrtmin () {
8
+ return SIGRTMIN ;
9
+ }
Original file line number Diff line number Diff line change
1
+ //! Compare libc's SIGRTMAX and SIGRTMIN functions against the actual C macros
2
+
3
+ extern crate libc;
4
+
5
+ #[ cfg( any(
6
+ target_os = "linux" ,
7
+ target_os = "l4re" ,
8
+ target_os = "android" ,
9
+ target_os = "emscripten"
10
+ ) ) ]
11
+ mod t {
12
+ use libc;
13
+
14
+ extern "C" {
15
+ pub fn sigrtmax ( ) -> libc:: c_int ;
16
+ pub fn sigrtmin ( ) -> libc:: c_int ;
17
+ }
18
+
19
+ #[ test]
20
+ fn test_sigrtmax ( ) {
21
+ unsafe {
22
+ assert_eq ! ( libc:: SIGRTMAX ( ) , sigrtmax( ) ) ;
23
+ }
24
+ }
25
+
26
+ #[ test]
27
+ fn test_sigrtmin ( ) {
28
+ unsafe {
29
+ assert_eq ! ( libc:: SIGRTMIN ( ) , sigrtmin( ) ) ;
30
+ }
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments