Skip to content

Commit 096670c

Browse files
committed
Ignore various entire test modules on emscripten
1 parent 525a798 commit 096670c

File tree

12 files changed

+11
-125
lines changed

12 files changed

+11
-125
lines changed

src/libstd/fs.rs

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,7 @@ impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
16861686
}
16871687
}
16881688

1689-
#[cfg(test)]
1689+
#[cfg(all(test, not(target_os = "emscripten")))]
16901690
mod tests {
16911691
use io::prelude::*;
16921692

@@ -1745,7 +1745,6 @@ mod tests {
17451745
}
17461746

17471747
#[test]
1748-
#[cfg_attr(target_os = "emscripten", ignore)]
17491748
fn file_test_io_smoke_test() {
17501749
let message = "it's alright. have a good time";
17511750
let tmpdir = tmpdir();
@@ -1767,7 +1766,6 @@ mod tests {
17671766
}
17681767

17691768
#[test]
1770-
#[cfg_attr(target_os = "emscripten", ignore)]
17711769
fn invalid_path_raises() {
17721770
let tmpdir = tmpdir();
17731771
let filename = &tmpdir.join("file_that_does_not_exist.txt");
@@ -1782,7 +1780,6 @@ mod tests {
17821780
}
17831781

17841782
#[test]
1785-
#[cfg_attr(target_os = "emscripten", ignore)]
17861783
fn file_test_iounlinking_invalid_path_should_raise_condition() {
17871784
let tmpdir = tmpdir();
17881785
let filename = &tmpdir.join("file_another_file_that_does_not_exist.txt");
@@ -1798,7 +1795,6 @@ mod tests {
17981795
}
17991796

18001797
#[test]
1801-
#[cfg_attr(target_os = "emscripten", ignore)]
18021798
fn file_test_io_non_positional_read() {
18031799
let message: &str = "ten-four";
18041800
let mut read_mem = [0; 8];
@@ -1825,7 +1821,6 @@ mod tests {
18251821
}
18261822

18271823
#[test]
1828-
#[cfg_attr(target_os = "emscripten", ignore)]
18291824
fn file_test_io_seek_and_tell_smoke_test() {
18301825
let message = "ten-four";
18311826
let mut read_mem = [0; 4];
@@ -1853,7 +1848,6 @@ mod tests {
18531848
}
18541849

18551850
#[test]
1856-
#[cfg_attr(target_os = "emscripten", ignore)]
18571851
fn file_test_io_seek_and_write() {
18581852
let initial_msg = "food-is-yummy";
18591853
let overwrite_msg = "-the-bar!!";
@@ -1878,7 +1872,6 @@ mod tests {
18781872
}
18791873

18801874
#[test]
1881-
#[cfg_attr(target_os = "emscripten", ignore)]
18821875
fn file_test_io_seek_shakedown() {
18831876
// 01234567890123
18841877
let initial_msg = "qwer-asdf-zxcv";
@@ -1911,7 +1904,6 @@ mod tests {
19111904
}
19121905

19131906
#[test]
1914-
#[cfg_attr(target_os = "emscripten", ignore)]
19151907
fn file_test_stat_is_correct_on_is_file() {
19161908
let tmpdir = tmpdir();
19171909
let filename = &tmpdir.join("file_stat_correct_on_is_file.txt");
@@ -1933,7 +1925,6 @@ mod tests {
19331925
}
19341926

19351927
#[test]
1936-
#[cfg_attr(target_os = "emscripten", ignore)]
19371928
fn file_test_stat_is_correct_on_is_dir() {
19381929
let tmpdir = tmpdir();
19391930
let filename = &tmpdir.join("file_stat_correct_on_is_dir");
@@ -1946,7 +1937,6 @@ mod tests {
19461937
}
19471938

19481939
#[test]
1949-
#[cfg_attr(target_os = "emscripten", ignore)]
19501940
fn file_test_fileinfo_false_when_checking_is_file_on_a_directory() {
19511941
let tmpdir = tmpdir();
19521942
let dir = &tmpdir.join("fileinfo_false_on_dir");
@@ -1956,7 +1946,6 @@ mod tests {
19561946
}
19571947

19581948
#[test]
1959-
#[cfg_attr(target_os = "emscripten", ignore)]
19601949
fn file_test_fileinfo_check_exists_before_and_after_file_creation() {
19611950
let tmpdir = tmpdir();
19621951
let file = &tmpdir.join("fileinfo_check_exists_b_and_a.txt");
@@ -1967,7 +1956,6 @@ mod tests {
19671956
}
19681957

19691958
#[test]
1970-
#[cfg_attr(target_os = "emscripten", ignore)]
19711959
fn file_test_directoryinfo_check_exists_before_and_after_mkdir() {
19721960
let tmpdir = tmpdir();
19731961
let dir = &tmpdir.join("before_and_after_dir");
@@ -1980,7 +1968,6 @@ mod tests {
19801968
}
19811969

19821970
#[test]
1983-
#[cfg_attr(target_os = "emscripten", ignore)]
19841971
fn file_test_directoryinfo_readdir() {
19851972
let tmpdir = tmpdir();
19861973
let dir = &tmpdir.join("di_readdir");
@@ -2010,7 +1997,6 @@ mod tests {
20101997
}
20111998

20121999
#[test]
2013-
#[cfg_attr(target_os = "emscripten", ignore)]
20142000
fn file_create_new_already_exists_error() {
20152001
let tmpdir = tmpdir();
20162002
let file = &tmpdir.join("file_create_new_error_exists");
@@ -2020,7 +2006,6 @@ mod tests {
20202006
}
20212007

20222008
#[test]
2023-
#[cfg_attr(target_os = "emscripten", ignore)]
20242009
fn mkdir_path_already_exists_error() {
20252010
let tmpdir = tmpdir();
20262011
let dir = &tmpdir.join("mkdir_error_twice");
@@ -2030,7 +2015,6 @@ mod tests {
20302015
}
20312016

20322017
#[test]
2033-
#[cfg_attr(target_os = "emscripten", ignore)]
20342018
fn recursive_mkdir() {
20352019
let tmpdir = tmpdir();
20362020
let dir = tmpdir.join("d1/d2");
@@ -2039,7 +2023,6 @@ mod tests {
20392023
}
20402024

20412025
#[test]
2042-
#[cfg_attr(target_os = "emscripten", ignore)]
20432026
fn recursive_mkdir_failure() {
20442027
let tmpdir = tmpdir();
20452028
let dir = tmpdir.join("d1");
@@ -2054,13 +2037,11 @@ mod tests {
20542037
}
20552038

20562039
#[test]
2057-
#[cfg_attr(target_os = "emscripten", ignore)]
20582040
fn recursive_mkdir_slash() {
20592041
check!(fs::create_dir_all(&Path::new("/")));
20602042
}
20612043

20622044
#[test]
2063-
#[cfg_attr(target_os = "emscripten", ignore)]
20642045
fn recursive_rmdir() {
20652046
let tmpdir = tmpdir();
20662047
let d1 = tmpdir.join("d1");
@@ -2080,7 +2061,6 @@ mod tests {
20802061
}
20812062

20822063
#[test]
2083-
#[cfg_attr(target_os = "emscripten", ignore)]
20842064
fn recursive_rmdir_of_symlink() {
20852065
// test we do not recursively delete a symlink but only dirs.
20862066
let tmpdir = tmpdir();
@@ -2114,7 +2094,6 @@ mod tests {
21142094
}
21152095

21162096
#[test]
2117-
#[cfg_attr(target_os = "emscripten", ignore)]
21182097
fn unicode_path_is_dir() {
21192098
assert!(Path::new(".").is_dir());
21202099
assert!(!Path::new("test/stdtest/fs.rs").is_dir());
@@ -2134,7 +2113,6 @@ mod tests {
21342113
}
21352114

21362115
#[test]
2137-
#[cfg_attr(target_os = "emscripten", ignore)]
21382116
fn unicode_path_exists() {
21392117
assert!(Path::new(".").exists());
21402118
assert!(!Path::new("test/nonexistent-bogus-path").exists());
@@ -2148,7 +2126,6 @@ mod tests {
21482126
}
21492127

21502128
#[test]
2151-
#[cfg_attr(target_os = "emscripten", ignore)]
21522129
fn copy_file_does_not_exist() {
21532130
let from = Path::new("test/nonexistent-bogus-path");
21542131
let to = Path::new("test/other-bogus-path");
@@ -2163,7 +2140,6 @@ mod tests {
21632140
}
21642141

21652142
#[test]
2166-
#[cfg_attr(target_os = "emscripten", ignore)]
21672143
fn copy_src_does_not_exist() {
21682144
let tmpdir = tmpdir();
21692145
let from = Path::new("test/nonexistent-bogus-path");
@@ -2177,7 +2153,6 @@ mod tests {
21772153
}
21782154

21792155
#[test]
2180-
#[cfg_attr(target_os = "emscripten", ignore)]
21812156
fn copy_file_ok() {
21822157
let tmpdir = tmpdir();
21832158
let input = tmpdir.join("in.txt");
@@ -2194,7 +2169,6 @@ mod tests {
21942169
}
21952170

21962171
#[test]
2197-
#[cfg_attr(target_os = "emscripten", ignore)]
21982172
fn copy_file_dst_dir() {
21992173
let tmpdir = tmpdir();
22002174
let out = tmpdir.join("out");
@@ -2206,7 +2180,6 @@ mod tests {
22062180
}
22072181

22082182
#[test]
2209-
#[cfg_attr(target_os = "emscripten", ignore)]
22102183
fn copy_file_dst_exists() {
22112184
let tmpdir = tmpdir();
22122185
let input = tmpdir.join("in");
@@ -2222,7 +2195,6 @@ mod tests {
22222195
}
22232196

22242197
#[test]
2225-
#[cfg_attr(target_os = "emscripten", ignore)]
22262198
fn copy_file_src_dir() {
22272199
let tmpdir = tmpdir();
22282200
let out = tmpdir.join("out");
@@ -2234,7 +2206,6 @@ mod tests {
22342206
}
22352207

22362208
#[test]
2237-
#[cfg_attr(target_os = "emscripten", ignore)]
22382209
fn copy_file_preserves_perm_bits() {
22392210
let tmpdir = tmpdir();
22402211
let input = tmpdir.join("in.txt");
@@ -2263,7 +2234,6 @@ mod tests {
22632234
}
22642235

22652236
#[test]
2266-
#[cfg_attr(target_os = "emscripten", ignore)]
22672237
fn symlinks_work() {
22682238
let tmpdir = tmpdir();
22692239
if !got_symlink_permission(&tmpdir) { return };
@@ -2282,7 +2252,6 @@ mod tests {
22822252
}
22832253

22842254
#[test]
2285-
#[cfg_attr(target_os = "emscripten", ignore)]
22862255
fn symlink_noexist() {
22872256
// Symlinks can point to things that don't exist
22882257
let tmpdir = tmpdir();
@@ -2296,7 +2265,6 @@ mod tests {
22962265
}
22972266

22982267
#[test]
2299-
#[cfg_attr(target_os = "emscripten", ignore)]
23002268
fn read_link() {
23012269
if cfg!(windows) {
23022270
// directory symlink
@@ -2317,7 +2285,6 @@ mod tests {
23172285
}
23182286

23192287
#[test]
2320-
#[cfg_attr(target_os = "emscripten", ignore)]
23212288
fn readlink_not_symlink() {
23222289
let tmpdir = tmpdir();
23232290
match fs::read_link(tmpdir.path()) {
@@ -2327,7 +2294,6 @@ mod tests {
23272294
}
23282295

23292296
#[test]
2330-
#[cfg_attr(target_os = "emscripten", ignore)]
23312297
fn links_work() {
23322298
let tmpdir = tmpdir();
23332299
let input = tmpdir.join("in.txt");
@@ -2356,7 +2322,6 @@ mod tests {
23562322
}
23572323

23582324
#[test]
2359-
#[cfg_attr(target_os = "emscripten", ignore)]
23602325
fn chmod_works() {
23612326
let tmpdir = tmpdir();
23622327
let file = tmpdir.join("in.txt");
@@ -2380,7 +2345,6 @@ mod tests {
23802345
}
23812346

23822347
#[test]
2383-
#[cfg_attr(target_os = "emscripten", ignore)]
23842348
fn sync_doesnt_kill_anything() {
23852349
let tmpdir = tmpdir();
23862350
let path = tmpdir.join("in.txt");
@@ -2394,7 +2358,6 @@ mod tests {
23942358
}
23952359

23962360
#[test]
2397-
#[cfg_attr(target_os = "emscripten", ignore)]
23982361
fn truncate_works() {
23992362
let tmpdir = tmpdir();
24002363
let path = tmpdir.join("in.txt");
@@ -2429,7 +2392,6 @@ mod tests {
24292392
}
24302393

24312394
#[test]
2432-
#[cfg_attr(target_os = "emscripten", ignore)]
24332395
fn open_flavors() {
24342396
use fs::OpenOptions as OO;
24352397
fn c<T: Clone>(t: &T) -> T { t.clone() }
@@ -2549,7 +2511,6 @@ mod tests {
25492511
}
25502512

25512513
#[test]
2552-
#[cfg_attr(target_os = "emscripten", ignore)]
25532514
fn binary_file() {
25542515
let mut bytes = [0; 1024];
25552516
StdRng::new().unwrap().fill_bytes(&mut bytes);
@@ -2563,7 +2524,6 @@ mod tests {
25632524
}
25642525

25652526
#[test]
2566-
#[cfg_attr(target_os = "emscripten", ignore)]
25672527
fn file_try_clone() {
25682528
let tmpdir = tmpdir();
25692529

@@ -2586,7 +2546,6 @@ mod tests {
25862546
}
25872547

25882548
#[test]
2589-
#[cfg_attr(target_os = "emscripten", ignore)]
25902549
#[cfg(not(windows))]
25912550
fn unlink_readonly() {
25922551
let tmpdir = tmpdir();
@@ -2599,15 +2558,13 @@ mod tests {
25992558
}
26002559

26012560
#[test]
2602-
#[cfg_attr(target_os = "emscripten", ignore)]
26032561
fn mkdir_trailing_slash() {
26042562
let tmpdir = tmpdir();
26052563
let path = tmpdir.join("file");
26062564
check!(fs::create_dir_all(&path.join("a/")));
26072565
}
26082566

26092567
#[test]
2610-
#[cfg_attr(target_os = "emscripten", ignore)]
26112568
fn canonicalize_works_simple() {
26122569
let tmpdir = tmpdir();
26132570
let tmpdir = fs::canonicalize(tmpdir.path()).unwrap();
@@ -2617,7 +2574,6 @@ mod tests {
26172574
}
26182575

26192576
#[test]
2620-
#[cfg_attr(target_os = "emscripten", ignore)]
26212577
fn realpath_works() {
26222578
let tmpdir = tmpdir();
26232579
if !got_symlink_permission(&tmpdir) { return };
@@ -2643,7 +2599,6 @@ mod tests {
26432599
}
26442600

26452601
#[test]
2646-
#[cfg_attr(target_os = "emscripten", ignore)]
26472602
fn realpath_works_tricky() {
26482603
let tmpdir = tmpdir();
26492604
if !got_symlink_permission(&tmpdir) { return };
@@ -2673,7 +2628,6 @@ mod tests {
26732628
}
26742629

26752630
#[test]
2676-
#[cfg_attr(target_os = "emscripten", ignore)]
26772631
fn dir_entry_methods() {
26782632
let tmpdir = tmpdir();
26792633

@@ -2708,14 +2662,12 @@ mod tests {
27082662
}
27092663

27102664
#[test]
2711-
#[cfg_attr(target_os = "emscripten", ignore)]
27122665
fn read_dir_not_found() {
27132666
let res = fs::read_dir("/path/that/does/not/exist");
27142667
assert_eq!(res.err().unwrap().kind(), ErrorKind::NotFound);
27152668
}
27162669

27172670
#[test]
2718-
#[cfg_attr(target_os = "emscripten", ignore)]
27192671
fn create_dir_all_with_junctions() {
27202672
let tmpdir = tmpdir();
27212673
let target = tmpdir.join("target");
@@ -2743,7 +2695,6 @@ mod tests {
27432695
}
27442696

27452697
#[test]
2746-
#[cfg_attr(target_os = "emscripten", ignore)]
27472698
fn metadata_access_times() {
27482699
let tmpdir = tmpdir();
27492700

0 commit comments

Comments
 (0)