Skip to content

Commit bdc41ec

Browse files
committed
Targeting environments that the snapshot tests work on
1 parent fc7a5ad commit bdc41ec

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/integration/cli/tests/snapshot.rs

+35
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ macro_rules! function {
401401
}};
402402
}
403403

404+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
404405
#[test]
405406
fn test_snapshot_condvar() {
406407
let snapshot = TestBuilder::new()
@@ -411,6 +412,7 @@ fn test_snapshot_condvar() {
411412
}
412413

413414
// Test that the expected default directories are present.
415+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
414416
#[test]
415417
fn test_snapshot_default_file_system_tree() {
416418
let snapshot = TestBuilder::new()
@@ -422,6 +424,7 @@ fn test_snapshot_default_file_system_tree() {
422424

423425
// TODO: figure out why this hangs on Windows and Mac OS
424426
#[cfg(target_os = "linux")]
427+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
425428
#[test]
426429
fn test_snapshot_stdin_stdout_stderr() {
427430
let snapshot = TestBuilder::new()
@@ -433,6 +436,7 @@ fn test_snapshot_stdin_stdout_stderr() {
433436
}
434437

435438
// Piping to cowsay should, well.... display a cow that says something
439+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
436440
#[test]
437441
fn test_snapshot_cowsay() {
438442
let snapshot = TestBuilder::new()
@@ -442,6 +446,7 @@ fn test_snapshot_cowsay() {
442446
assert_json_snapshot!(snapshot);
443447
}
444448

449+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
445450
#[test]
446451
fn test_snapshot_epoll() {
447452
let snapshot = TestBuilder::new()
@@ -450,6 +455,7 @@ fn test_snapshot_epoll() {
450455
assert_json_snapshot!(snapshot);
451456
}
452457

458+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
453459
#[test]
454460
fn test_snapshot_file_copy() {
455461
let snapshot = TestBuilder::new()
@@ -462,6 +468,7 @@ fn test_snapshot_file_copy() {
462468
assert_json_snapshot!(snapshot);
463469
}
464470

471+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
465472
#[test]
466473
fn test_snapshot_execve() {
467474
let snapshot = TestBuilder::new()
@@ -471,6 +478,7 @@ fn test_snapshot_execve() {
471478
assert_json_snapshot!(snapshot);
472479
}
473480

481+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
474482
#[test]
475483
fn test_snapshot_web_server() {
476484
let with_inner = || {
@@ -567,6 +575,7 @@ rm -f /cfg/config.toml
567575
// The ability to fork the current process and run a different image but retain
568576
// the existing open file handles (which is needed for stdin and stdout redirection)
569577
#[cfg(not(target_os = "windows"))]
578+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
570579
#[test]
571580
fn test_snapshot_fork_and_exec() {
572581
let snapshot = TestBuilder::new()
@@ -578,6 +587,7 @@ fn test_snapshot_fork_and_exec() {
578587

579588
// longjmp is used by C programs that save and restore the stack at specific
580589
// points - this functionality is often used for exception handling
590+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
581591
#[test]
582592
fn test_snapshot_longjump() {
583593
let snapshot = TestBuilder::new()
@@ -589,6 +599,7 @@ fn test_snapshot_longjump() {
589599

590600
// Another longjump test.
591601
// This one is initiated from `rust` code and thus has the risk of leaking memory but uses different interfaces
602+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
592603
#[test]
593604
fn test_snapshot_longjump2() {
594605
let snapshot = TestBuilder::new()
@@ -599,6 +610,7 @@ fn test_snapshot_longjump2() {
599610
}
600611

601612
// Simple fork example that is a crude multi-threading implementation - used by `dash`
613+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
602614
#[test]
603615
fn test_snapshot_fork() {
604616
let snapshot = TestBuilder::new()
@@ -610,6 +622,7 @@ fn test_snapshot_fork() {
610622

611623
// Uses the `fd_pipe` syscall to create a bidirection pipe with two file
612624
// descriptors then forks the process to write and read to this pipe.
625+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
613626
#[test]
614627
fn test_snapshot_pipes() {
615628
let snapshot = TestBuilder::new()
@@ -623,6 +636,7 @@ fn test_snapshot_pipes() {
623636
// This test ensures that the stacks that have been recorded are preserved
624637
// after a fork.
625638
// The behavior is needed for `dash`
639+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
626640
#[test]
627641
fn test_snapshot_longjump_fork() {
628642
let snapshot = TestBuilder::new()
@@ -632,6 +646,7 @@ fn test_snapshot_longjump_fork() {
632646
}
633647

634648
// full multi-threading with shared memory and shared compiled modules
649+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
635650
#[test]
636651
fn test_snapshot_multithreading() {
637652
let snapshot = TestBuilder::new()
@@ -643,6 +658,7 @@ fn test_snapshot_multithreading() {
643658

644659
// full multi-threading with shared memory and shared compiled modules
645660
#[cfg(target_os = "linux")]
661+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
646662
#[test]
647663
fn test_snapshot_sleep() {
648664
let snapshot = TestBuilder::new()
@@ -653,6 +669,7 @@ fn test_snapshot_sleep() {
653669

654670
// Uses `posix_spawn` to launch a sub-process and wait on it to exit
655671
#[cfg(not(target_os = "windows"))]
672+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
656673
#[test]
657674
fn test_snapshot_process_spawn() {
658675
let snapshot = TestBuilder::new()
@@ -675,6 +692,7 @@ fn test_snapshot_process_spawn() {
675692

676693
// Tests that thread local variables work correctly
677694
#[cfg(target_os = "linux")]
695+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
678696
#[test]
679697
fn test_snapshot_thread_locals() {
680698
let mut snapshot = TestBuilder::new()
@@ -696,6 +714,7 @@ fn test_snapshot_thread_locals() {
696714

697715
// Tests that lightweight forking that does not copy the memory but retains the
698716
// open file descriptors works correctly.
717+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
699718
#[test]
700719
fn test_snapshot_vfork() {
701720
let snapshot = TestBuilder::new()
@@ -705,6 +724,7 @@ fn test_snapshot_vfork() {
705724
assert_json_snapshot!(snapshot);
706725
}
707726

727+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
708728
#[test]
709729
fn test_snapshot_signals() {
710730
let snapshot = TestBuilder::new()
@@ -714,6 +734,7 @@ fn test_snapshot_signals() {
714734
}
715735

716736
#[cfg(target_os = "linux")]
737+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
717738
#[test]
718739
fn test_snapshot_dash_echo() {
719740
let snapshot = TestBuilder::new()
@@ -723,6 +744,7 @@ fn test_snapshot_dash_echo() {
723744
assert_json_snapshot!(snapshot);
724745
}
725746

747+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
726748
#[test]
727749
fn test_snapshot_dash_echo_to_cat() {
728750
let snapshot = TestBuilder::new()
@@ -733,6 +755,7 @@ fn test_snapshot_dash_echo_to_cat() {
733755
assert_json_snapshot!(snapshot);
734756
}
735757

758+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
736759
#[test]
737760
fn test_snapshot_dash_python() {
738761
let snapshot = TestBuilder::new()
@@ -744,6 +767,7 @@ fn test_snapshot_dash_python() {
744767
assert_json_snapshot!(snapshot);
745768
}
746769

770+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
747771
#[test]
748772
fn test_snapshot_dash_dev_zero() {
749773
let snapshot = TestBuilder::new()
@@ -754,6 +778,7 @@ fn test_snapshot_dash_dev_zero() {
754778
assert_json_snapshot!(snapshot);
755779
}
756780

781+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
757782
#[test]
758783
fn test_snapshot_dash_dev_urandom() {
759784
let snapshot = TestBuilder::new()
@@ -764,6 +789,7 @@ fn test_snapshot_dash_dev_urandom() {
764789
assert_json_snapshot!(snapshot);
765790
}
766791

792+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
767793
#[test]
768794
fn test_snapshot_dash_dash() {
769795
let snapshot = TestBuilder::new()
@@ -774,6 +800,7 @@ fn test_snapshot_dash_dash() {
774800
assert_json_snapshot!(snapshot);
775801
}
776802

803+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
777804
#[test]
778805
fn test_snapshot_dash_bash() {
779806
let snapshot = TestBuilder::new()
@@ -784,6 +811,7 @@ fn test_snapshot_dash_bash() {
784811
assert_json_snapshot!(snapshot);
785812
}
786813

814+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
787815
#[test]
788816
fn test_snapshot_bash_echo() {
789817
let snapshot = TestBuilder::new()
@@ -793,6 +821,7 @@ fn test_snapshot_bash_echo() {
793821
assert_json_snapshot!(snapshot);
794822
}
795823

824+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
796825
#[test]
797826
fn test_snapshot_bash_ls() {
798827
let snapshot = TestBuilder::new()
@@ -803,6 +832,7 @@ fn test_snapshot_bash_ls() {
803832
assert_json_snapshot!(snapshot);
804833
}
805834

835+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
806836
#[test]
807837
fn test_snapshot_bash_pipe() {
808838
let snapshot = TestBuilder::new()
@@ -813,6 +843,7 @@ fn test_snapshot_bash_pipe() {
813843
assert_json_snapshot!(snapshot);
814844
}
815845

846+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
816847
#[test]
817848
fn test_snapshot_bash_python() {
818849
let snapshot = TestBuilder::new()
@@ -824,6 +855,7 @@ fn test_snapshot_bash_python() {
824855
assert_json_snapshot!(snapshot);
825856
}
826857

858+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
827859
#[test]
828860
fn test_snapshot_bash_bash() {
829861
let snapshot = TestBuilder::new()
@@ -834,6 +866,7 @@ fn test_snapshot_bash_bash() {
834866
assert_json_snapshot!(snapshot);
835867
}
836868

869+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
837870
#[test]
838871
fn test_snapshot_bash_dash() {
839872
let snapshot = TestBuilder::new()
@@ -844,6 +877,7 @@ fn test_snapshot_bash_dash() {
844877
assert_json_snapshot!(snapshot);
845878
}
846879

880+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
847881
#[test]
848882
fn test_snapshot_catsay() {
849883
let snapshot = TestBuilder::new()
@@ -853,6 +887,7 @@ fn test_snapshot_catsay() {
853887
assert_json_snapshot!(snapshot);
854888
}
855889

890+
#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))]
856891
#[test]
857892
fn test_snapshot_quickjs() {
858893
let snapshot = TestBuilder::new()

0 commit comments

Comments
 (0)