Skip to content

Commit

Permalink
v0.0.3 - 优化CPU检测逻辑和提示
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Jun 25, 2024
1 parent 21c9c75 commit 9809ff0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
TAG="v0.0.2-$(date +'%Y%m%d%H%M%S')"
TAG="v0.0.3-$(date +'%Y%m%d%H%M%S')"
git tag $TAG
git push origin $TAG
env:
Expand Down
16 changes: 10 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,24 @@ func main() {
testThread = strings.TrimSpace(strings.ToLower(*testThreadsPtr))
}
if runtime.GOOS == "windows" {
res = cpu.WinsatTest(language, testThread)
res = "Detected host is Windows, using Winsat for testing.\n"
res += cpu.WinsatTest(language, testThread)
} else {
if testMethod == "sysbench" {
switch testMethod {
case "sysbench":
res = cpu.SysBenchTest(language, testThread)
if res == "" {
res = "sysbench test failed, switch to use geekbench test.\n"
res = "Sysbench test failed, switching to Geekbench for testing.\n"
res += cpu.GeekBenchTest(language, testThread)
}
} else if testMethod == "geekbench" {
case "geekbench":
res = cpu.GeekBenchTest(language, testThread)
if res == "" {
res = "geekbench test failed, switch to use sysbench test.\n"
res += cpu.GeekBenchTest(language, testThread)
res = "Geekbench test failed, switching to Sysbench for testing.\n"
res += cpu.SysBenchTest(language, testThread)
}
default:
res = "Invalid test method specified.\n"
}
}
fmt.Println("--------------------------------------------------")
Expand Down
2 changes: 1 addition & 1 deletion cpu/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package cpu

const CpuTestVersion = "v0.0.2" // git tag v0.0.2
const CpuTestVersion = "v0.0.3"

0 comments on commit 9809ff0

Please sign in to comment.