File tree 4 files changed +28
-5
lines changed
4 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ language: rust
2
2
rust :
3
3
- stable
4
4
- nightly
5
- os : osx
5
+ os :
6
+ - osx
7
+ - linux
6
8
env :
7
9
- IOS_ARCHS=""
8
10
matrix :
@@ -14,3 +16,7 @@ matrix:
14
16
sudo : false
15
17
install : ./travis_install.sh
16
18
script : ./travis_test.sh
19
+ addons :
20
+ apt :
21
+ packages :
22
+ - libdispatch-dev
Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ pub type dispatch_time_t = u64;
24
24
// dispatch_io_interval_flags_t
25
25
pub type dispatch_queue_attr_t = * const dispatch_object_s ;
26
26
27
- #[ link( name = "System" , kind = "dylib" ) ]
27
+ #[ cfg_attr( any( target_os = "macos" , target_os = "ios" ) ,
28
+ link( name = "System" , kind = "dylib" ) ) ]
29
+ #[ cfg_attr( not( any( target_os = "macos" , target_os = "ios" ) ) ,
30
+ link( name = "dispatch" , kind = "dylib" ) ) ]
28
31
extern {
29
32
static _dispatch_main_q: dispatch_object_s ;
30
33
static _dispatch_queue_attr_concurrent: dispatch_object_s ;
Original file line number Diff line number Diff line change @@ -66,12 +66,21 @@ pub enum QueueAttribute {
66
66
}
67
67
68
68
impl QueueAttribute {
69
+ #[ cfg( not( all( test, target_os = "linux" ) ) ) ]
69
70
fn as_raw ( & self ) -> dispatch_queue_attr_t {
70
71
match * self {
71
72
QueueAttribute :: Serial => DISPATCH_QUEUE_SERIAL ,
72
73
QueueAttribute :: Concurrent => DISPATCH_QUEUE_CONCURRENT ,
73
74
}
74
75
}
76
+
77
+ #[ cfg( all( test, target_os = "linux" ) ) ]
78
+ fn as_raw ( & self ) -> dispatch_queue_attr_t {
79
+ // The Linux tests use Ubuntu's libdispatch-dev package, which is
80
+ // apparently really old from before OSX 10.7.
81
+ // Back then, the attr for dispatch_queue_create must be NULL.
82
+ ptr:: null ( )
83
+ }
75
84
}
76
85
77
86
/// The priority of a global concurrent queue.
Original file line number Diff line number Diff line change 2
2
3
3
set -eu
4
4
5
- if [ -z " $IOS_ARCHS " ]; then
5
+ if [ -n " $IOS_ARCHS " ]; then
6
+ ./rust-test-ios
7
+ elif [ " $TRAVIS_OS_NAME " = " linux" ]; then
6
8
cargo build --verbose
7
- cargo test --verbose
9
+ # The Ubuntu libdispatch doesn't seem to be in great shape,
10
+ # so just run a quick smoke test of the basic cases.
11
+ cargo test --verbose test_serial_queue
8
12
else
9
- ./rust-test-ios
13
+ cargo build --verbose
14
+ cargo test --verbose
10
15
fi
You can’t perform that action at this time.
0 commit comments