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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/shirou/gopsutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLoad(t *testing.T) {
|
func TestLoad(t *testing.T) {
|
||||||
v, err := gopsutil.LoadAvg()
|
v, err := LoadAvg()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("error %v", err)
|
t.Errorf("error %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
empty := &gopsutil.LoadAvgStat{}
|
empty := &LoadAvgStat{}
|
||||||
if v == empty {
|
if v == empty {
|
||||||
t.Errorf("error load: %v", v)
|
t.Errorf("error load: %v", v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLoadAvgStat_String(t *testing.T) {
|
func TestLoadAvgStat_String(t *testing.T) {
|
||||||
v := gopsutil.LoadAvgStat{
|
v := LoadAvgStat{
|
||||||
Load1: 10.1,
|
Load1: 10.1,
|
||||||
Load5: 20.1,
|
Load5: 20.1,
|
||||||
Load15: 30.1,
|
Load15: 30.1,
|
@ -1,19 +1,17 @@
|
|||||||
// +build linux freebsd
|
// +build linux freebsd
|
||||||
|
|
||||||
package test
|
package gopsutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/shirou/gopsutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_SendSignal(t *testing.T) {
|
func Test_SendSignal(t *testing.T) {
|
||||||
checkPid := os.Getpid()
|
checkPid := os.Getpid()
|
||||||
|
|
||||||
p, _ := gopsutil.NewProcess(int32(checkPid))
|
p, _ := NewProcess(int32(checkPid))
|
||||||
err := p.SendSignal(syscall.SIGCONT)
|
err := p.SendSignal(syscall.SIGCONT)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("send signal %v", err)
|
t.Errorf("send signal %v", err)
|
Loading…
Reference in New Issue