Commit Graph

5 Commits (6a5e40a517666725d73c6d5cd0bbc738892cae5b)

Author SHA1 Message Date
Eng Zer Jun 37894e9b28
test: use `T.Setenv` to set env vars in tests
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Ville Skyttä f7e1f36418 refactor: remove unnecessary exec.LookPath calls
Executing the command does the lookup if needed and returns the same
error when not found, no need to do it separately.
Lomanic 6589c5c274 [cpu][linux] Fix #1037 only count logical cores where 2nd field is a number
Lomanic bb6f6e4968 [cpu][linux] Test Counts against lscpu results
WAKAYAMA Shirou 4c9fd1f200 [cpu]linux: add testcode with testdata.