Free MacOS CPU hardware stress test, with one line of command only! And it does not required sudo permissions to run
for i in {1..8}; do `yes $i > /dev/null & `; done ; sleep 300 && killall yes && echo "CPU stress test completed" &
sleep 300 — is the controls for how long you want this test to run, for example 300 is seconds (5 minutes), you can change it at will
for i in {1..8} — will execute 8 times the command yes, this is to fill up 8 cores, if your laptop has 8 cores, if note it will distribute through the available ones
you are welcome,