File tree Expand file tree Collapse file tree 5 files changed +39
-4
lines changed Expand file tree Collapse file tree 5 files changed +39
-4
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ spnego = ["curl-sys/spnego"]
44
44
static-curl = [" curl-sys/static-curl" ]
45
45
static-ssl = [" curl-sys/static-ssl" ]
46
46
force-system-lib-on-osx = [' curl-sys/force-system-lib-on-osx' ]
47
+ protocol-ftp = [" curl-sys/protocol-ftp" ]
47
48
48
49
[[test ]]
49
50
name = " atexit"
Original file line number Diff line number Diff line change 3
3
set -ex
4
4
5
5
cargo test --target $TARGET --no-run
6
- cargo test --target $TARGET --no-run --features curl-sys/static-curl
6
+ # First test with no extra protocols enabled.
7
+ cargo test --target $TARGET --no-run --features static-curl
8
+ # Then with all extra protocols enabled.
9
+ cargo test --target $TARGET --no-run --features static-curl,protocol-ftp
7
10
if [ -z " $NO_RUN " ]; then
8
11
cargo test --target $TARGET
9
- cargo test --target $TARGET --features curl-sys/static-curl
12
+ cargo test --target $TARGET --features static-curl
13
+ cargo test --target $TARGET --features static-curl,protocol-ftp
10
14
cargo run --manifest-path systest/Cargo.toml --target $TARGET
11
- cargo run --manifest-path systest/Cargo.toml --target $TARGET --features curl-sys/static-curl
15
+ cargo run --manifest-path systest/Cargo.toml --target $TARGET --features curl-sys/static-curl,curl-sys/protocol-ftp
12
16
cargo doc --no-deps --target $TARGET
13
17
cargo doc --no-deps -p curl-sys --target $TARGET
14
18
fi
Original file line number Diff line number Diff line change @@ -50,3 +50,4 @@ static-curl = []
50
50
static-ssl = [" openssl-sys/vendored" ]
51
51
spnego = []
52
52
force-system-lib-on-osx = []
53
+ protocol-ftp = []
Original file line number Diff line number Diff line change @@ -116,7 +116,6 @@ fn main() {
116
116
. define ( "BUILDING_LIBCURL" , None )
117
117
. define ( "CURL_DISABLE_CRYPTO_AUTH" , None )
118
118
. define ( "CURL_DISABLE_DICT" , None )
119
- . define ( "CURL_DISABLE_FTP" , None )
120
119
. define ( "CURL_DISABLE_GOPHER" , None )
121
120
. define ( "CURL_DISABLE_IMAP" , None )
122
121
. define ( "CURL_DISABLE_LDAP" , None )
@@ -202,6 +201,15 @@ fn main() {
202
201
. define ( "HAVE_GETPEERNAME" , None )
203
202
. warnings ( false ) ;
204
203
204
+ if cfg ! ( feature = "protocol-ftp" ) {
205
+ cfg. file ( "curl/lib/curl_fnmatch.c" )
206
+ . file ( "curl/lib/ftp.c" )
207
+ . file ( "curl/lib/ftplistparser.c" )
208
+ . file ( "curl/lib/pingpong.c" ) ;
209
+ } else {
210
+ cfg. define ( "CURL_DISABLE_FTP" , None ) ;
211
+ }
212
+
205
213
if cfg ! ( feature = "http2" ) {
206
214
cfg. define ( "USE_NGHTTP2" , None )
207
215
. define ( "NGHTTP2_STATICLIB" , None ) ;
Original file line number Diff line number Diff line change
1
+ extern crate curl;
2
+
3
+ #[ cfg( all( feature = "static-curl" , not( feature = "protocol-ftp" ) ) ) ]
4
+ #[ test]
5
+ fn static_with_ftp_disabled ( ) {
6
+ assert ! ( curl:: Version :: get( )
7
+ . protocols( )
8
+ . filter( |& p| p == "ftp" )
9
+ . next( )
10
+ . is_none( ) ) ;
11
+ }
12
+
13
+ #[ cfg( all( feature = "static-curl" , feature = "protocol-ftp" ) ) ]
14
+ #[ test]
15
+ fn static_with_ftp_enabled ( ) {
16
+ assert ! ( curl:: Version :: get( )
17
+ . protocols( )
18
+ . filter( |& p| p == "ftp" )
19
+ . next( )
20
+ . is_some( ) ) ;
21
+ }
You can’t perform that action at this time.
0 commit comments