caddy/dist/automate_test.go

16 lines
318 B
Go
Raw Normal View History

2016-06-21 09:11:55 +03:00
package main
import (
"runtime"
"testing"
)
func TestNumProcs(t *testing.T) {
2016-06-21 09:23:18 +03:00
num := runtime.NumCPU()
2016-06-21 09:11:55 +03:00
n := numProcs()
if n > num || n < 1 {
t.Errorf("Expected numProcs() to return max(NumCPU-1, 1) or at least some "+
"reasonable value (depending on CI environment), but got n=%d (NumCPU=%d)", n, num)
2016-06-21 09:11:55 +03:00
}
}