@@ -3,11 +3,11 @@ use std::fs::File;
33use std:: io:: prelude:: * ;
44use std:: path:: Path ;
55
6- use crate :: support:: cargo_process;
76use crate :: support:: paths:: CargoPathExt ;
87use crate :: support:: registry:: Package ;
98use crate :: support:: {
10- basic_manifest, git, path2url, paths, project, publish:: validate_crate_contents, registry,
9+ basic_manifest, cargo_process, git, path2url, paths, project, publish:: validate_crate_contents,
10+ registry, symlink_supported,
1111} ;
1212use git2;
1313
@@ -505,22 +505,20 @@ fn package_git_submodule() {
505505}
506506
507507#[ cargo_test]
508- #[ cfg_attr( windows, ignore) ]
509508/// Tests if a symlink to a git submodule is properly handled.
510509///
511- /// This test is ignored on Windows, because it needs Administrator
512- /// permissions to run. If you do want to run this test, please
513- /// run the tests with ``--ignored``, e.g.
514- ///
515- /// ```text
516- /// cargo test -- --ignored
517- /// ```
510+ /// This test requires you to be able to make symlinks.
511+ /// For windows, this may require you to enable developer mode.
518512fn package_symlink_to_submodule ( ) {
519513 #[ cfg( unix) ]
520514 use std:: os:: unix:: fs:: symlink;
521515 #[ cfg( windows) ]
522516 use std:: os:: windows:: fs:: symlink_dir as symlink;
523517
518+ if !symlink_supported ( ) {
519+ return ;
520+ }
521+
524522 let project = git:: new ( "foo" , |project| {
525523 project. file ( "src/lib.rs" , "pub fn foo() {}" )
526524 } )
@@ -712,22 +710,20 @@ See [..]
712710}
713711
714712#[ cargo_test]
715- #[ cfg_attr( windows, ignore) ]
716713/// Tests if a broken symlink is properly handled when packaging.
717714///
718- /// This test is ignored on Windows, because it needs Administrator
719- /// permissions to run. If you do want to run this test, please
720- /// run the tests with ``--ignored``, e.g.
721- ///
722- /// ```text
723- /// cargo test -- --ignored
724- /// ```
715+ /// This test requires you to be able to make symlinks.
716+ /// For windows, this may require you to enable developer mode.
725717fn broken_symlink ( ) {
726718 #[ cfg( unix) ]
727719 use std:: os:: unix:: fs:: symlink;
728720 #[ cfg( windows) ]
729721 use std:: os:: windows:: fs:: symlink_dir as symlink;
730722
723+ if !symlink_supported ( ) {
724+ return ;
725+ }
726+
731727 let p = project ( )
732728 . file (
733729 "Cargo.toml" ,
@@ -764,17 +760,16 @@ Caused by:
764760}
765761
766762#[ cargo_test]
767- #[ cfg_attr( windows, ignore) ]
768763/// Tests if a symlink to a directory is proberly included.
769764///
770- /// This test is ignored on Windows, because it needs Administrator
771- /// permissions to run. If you do want to run this test, please
772- /// run the tests with ``--ignored``, e.g.
773- ///
774- /// ```text
775- /// cargo test -- --ignored
776- /// ```
765+ /// This test requires you to be able to make symlinks.
766+ /// For windows, this may require you to enable developer mode.
777767fn package_symlink_to_dir ( ) {
768+
769+ if !symlink_supported ( ) {
770+ return ;
771+ }
772+
778773 project ( )
779774 . file ( "src/main.rs" , r#"fn main() { println!("hello"); }"# )
780775 . file ( "bla/Makefile" , "all:" )
0 commit comments