[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
This commit is contained in:
Lomanic 2023-07-01 14:40:54 +02:00
parent f08589cdac
commit c0f3eb1dfb
1 changed files with 0 additions and 54 deletions

View File

@ -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++ {