2024-10-03 14:52:46 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\Tests\builder\macos;
|
|
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
use SPC\builder\macos\SystemUtil;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @internal
|
|
|
|
|
*/
|
|
|
|
|
class SystemUtilTest extends TestCase
|
|
|
|
|
{
|
|
|
|
|
public static function setUpBeforeClass(): void
|
|
|
|
|
{
|
|
|
|
|
if (PHP_OS_FAMILY !== 'Darwin') {
|
2025-03-07 18:06:32 +08:00
|
|
|
self::markTestSkipped('This test is only for macOS');
|
2024-10-03 14:52:46 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testGetCpuCount()
|
|
|
|
|
{
|
|
|
|
|
$this->assertIsInt(SystemUtil::getCpuCount());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testGetArchCFlags()
|
|
|
|
|
{
|
|
|
|
|
$this->assertEquals('--target=x86_64-apple-darwin', SystemUtil::getArchCFlags('x86_64'));
|
|
|
|
|
}
|
|
|
|
|
}
|