-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcpu_test.go
58 lines (45 loc) · 1.09 KB
/
cpu_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) The M1CPU Authors
// SPDX-License-Identifier: MPL-2.0
//go:build darwin && arm64 && cgo
package m1cpu
import (
"testing"
"github.com/shoenig/test/must"
)
func Test_PCoreHz(t *testing.T) {
hz := PCoreHz()
must.Greater(t, 3_000_000_000, hz)
}
func Test_ECoreHz(t *testing.T) {
hz := ECoreHz()
must.Greater(t, 1_000_000_000, hz)
}
func Test_PCoreGHz(t *testing.T) {
ghz := PCoreGHz()
must.Greater(t, 3, ghz)
}
func Test_ECoreGHz(t *testing.T) {
ghz := ECoreGHz()
must.Greater(t, 1, ghz)
}
func Test_PCoreCount(t *testing.T) {
n := PCoreCount()
must.Positive(t, n)
}
func Test_ECoreCount(t *testing.T) {
n := ECoreCount()
must.Positive(t, n)
}
func Test_Show(t *testing.T) {
t.Log("model name", ModelName())
t.Log("pCore Hz", PCoreHz())
t.Log("eCore Hz", ECoreHz())
t.Log("pCore GHz", PCoreGHz())
t.Log("eCore GHz", ECoreGHz())
t.Log("pCore count", PCoreCount())
t.Log("eCoreCount", ECoreCount())
pL1Inst, pL1Data, pL2 := PCoreCache()
t.Log("pCore Caches", pL1Inst, pL1Data, pL2)
eL1Inst, eL1Data, eL2 := ECoreCache()
t.Log("eCore Caches", eL1Inst, eL1Data, eL2)
}