From c0f3eb1dfb9058724390a759d0d7b7cc2149bb69 Mon Sep 17 00:00:00 2001 From: Lomanic <5020919+Lomanic@users.noreply.github.com> Date: Sat, 1 Jul 2023 14:40:54 +0200 Subject: [PATCH] [process] Remove all noisy and useless Test_AllProcesses_X tests These tests can't fail more than their invidiual counterparts and produce an incredibly verbose output --- process/process_test.go | 54 ----------------------------------------- 1 file changed, 54 deletions(-) diff --git a/process/process_test.go b/process/process_test.go index 5d1cb29..15e2327 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -785,60 +785,6 @@ func Test_Process_Cwd(t *testing.T) { t.Log(pidCwd) } -func Test_AllProcesses_cmdLine(t *testing.T) { - procs, err := Processes() - skipIfNotImplementedErr(t, err) - if err != nil { - t.Fatalf("getting processes error %v", err) - } - for _, proc := range procs { - var exeName string - var cmdLine string - - exeName, _ = proc.Exe() - cmdLine, err = proc.Cmdline() - if err != nil { - cmdLine = "Error: " + err.Error() - } - - t.Logf("Process #%v: Name: %v / CmdLine: %v\n", proc.Pid, exeName, cmdLine) - } -} - -func Test_AllProcesses_environ(t *testing.T) { - procs, err := Processes() - skipIfNotImplementedErr(t, err) - if err != nil { - t.Fatalf("getting processes error %v", err) - } - for _, proc := range procs { - exeName, _ := proc.Exe() - environ, err := proc.Environ() - if err != nil { - environ = []string{"Error: " + err.Error()} - } - - t.Logf("Process #%v: Name: %v / Environment Variables: %v\n", proc.Pid, exeName, environ) - } -} - -func Test_AllProcesses_Cwd(t *testing.T) { - procs, err := Processes() - skipIfNotImplementedErr(t, err) - if err != nil { - t.Fatalf("getting processes error %v", err) - } - for _, proc := range procs { - exeName, _ := proc.Exe() - cwd, err := proc.Cwd() - if err != nil { - cwd = "Error: " + err.Error() - } - - t.Logf("Process #%v: Name: %v / Current Working Directory: %s\n", proc.Pid, exeName, cwd) - } -} - func BenchmarkNewProcess(b *testing.B) { checkPid := os.Getpid() for i := 0; i < b.N; i++ {