mirror of https://github.com/shirou/gopsutil
could not get coverage from test subdirectory. move back to top.
But it becomes messy again.pull/4/head
parent
1464099024
commit
45710b5c9d
@ -1,26 +1,24 @@
|
||||
package test
|
||||
package gopsutil
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/shirou/gopsutil"
|
||||
)
|
||||
|
||||
func TestLoad(t *testing.T) {
|
||||
v, err := gopsutil.LoadAvg()
|
||||
v, err := LoadAvg()
|
||||
if err != nil {
|
||||
t.Errorf("error %v", err)
|
||||
}
|
||||
|
||||
empty := &gopsutil.LoadAvgStat{}
|
||||
empty := &LoadAvgStat{}
|
||||
if v == empty {
|
||||
t.Errorf("error load: %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadAvgStat_String(t *testing.T) {
|
||||
v := gopsutil.LoadAvgStat{
|
||||
v := LoadAvgStat{
|
||||
Load1: 10.1,
|
||||
Load5: 20.1,
|
||||
Load15: 30.1,
|
@ -1,19 +1,17 @@
|
||||
// +build linux freebsd
|
||||
|
||||
package test
|
||||
package gopsutil
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
"github.com/shirou/gopsutil"
|
||||
)
|
||||
|
||||
func Test_SendSignal(t *testing.T) {
|
||||
checkPid := os.Getpid()
|
||||
|
||||
p, _ := gopsutil.NewProcess(int32(checkPid))
|
||||
p, _ := NewProcess(int32(checkPid))
|
||||
err := p.SendSignal(syscall.SIGCONT)
|
||||
if err != nil {
|
||||
t.Errorf("send signal %v", err)
|
Loading…
Reference in New Issue