SystemUtilTest.php 641 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. declare(strict_types=1);
  3. namespace SPC\Tests\builder\macos;
  4. use PHPUnit\Framework\TestCase;
  5. use SPC\builder\macos\SystemUtil;
  6. /**
  7. * @internal
  8. */
  9. class SystemUtilTest extends TestCase
  10. {
  11. public static function setUpBeforeClass(): void
  12. {
  13. if (PHP_OS_FAMILY !== 'Darwin') {
  14. self::markTestIncomplete('This test is only for macOS');
  15. }
  16. }
  17. public function testGetCpuCount()
  18. {
  19. $this->assertIsInt(SystemUtil::getCpuCount());
  20. }
  21. public function testGetArchCFlags()
  22. {
  23. $this->assertEquals('--target=x86_64-apple-darwin', SystemUtil::getArchCFlags('x86_64'));
  24. }
  25. }