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"]
4444static-curl = [" curl-sys/static-curl" ]
4545static-ssl = [" curl-sys/static-ssl" ]
4646force-system-lib-on-osx = [' curl-sys/force-system-lib-on-osx' ]
47+ protocol-ftp = [" curl-sys/protocol-ftp" ]
4748
4849[[test ]]
4950name = " atexit"
Original file line number Diff line number Diff line change 33set -ex
44
55cargo 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
710if [ -z " $NO_RUN " ]; then
811 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
1014 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
1216 cargo doc --no-deps --target $TARGET
1317 cargo doc --no-deps -p curl-sys --target $TARGET
1418fi
Original file line number Diff line number Diff line change @@ -50,3 +50,4 @@ static-curl = []
5050static-ssl = [" openssl-sys/vendored" ]
5151spnego = []
5252force-system-lib-on-osx = []
53+ protocol-ftp = []
Original file line number Diff line number Diff line change @@ -116,7 +116,6 @@ fn main() {
116116 . define ( "BUILDING_LIBCURL" , None )
117117 . define ( "CURL_DISABLE_CRYPTO_AUTH" , None )
118118 . define ( "CURL_DISABLE_DICT" , None )
119- . define ( "CURL_DISABLE_FTP" , None )
120119 . define ( "CURL_DISABLE_GOPHER" , None )
121120 . define ( "CURL_DISABLE_IMAP" , None )
122121 . define ( "CURL_DISABLE_LDAP" , None )
@@ -202,6 +201,15 @@ fn main() {
202201 . define ( "HAVE_GETPEERNAME" , None )
203202 . warnings ( false ) ;
204203
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+
205213 if cfg ! ( feature = "http2" ) {
206214 cfg. define ( "USE_NGHTTP2" , None )
207215 . 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