Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Apu/Sink/PipeAudioSink.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,12 @@ private function closePipe(): void
$this->flush();

// Close pipe
@pclose($this->pipe);
$pipe = $this->pipe;
$this->pipe = null;

if (is_resource($pipe)) {
@pclose($pipe);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/BlarggTestRomsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
final class BlarggTestRomsTest extends TestCase
{
private const ROM_BASE_PATH = __DIR__ . '/../../third_party/roms';
private const TIMEOUT = 35; // 35 seconds per test (increased for 11-op a,(hl).gb)
private const TIMEOUT = 60; // 60 seconds per test (increased for M-cycle accurate execution)

private TestRomRunner $runner;

Expand Down
10 changes: 2 additions & 8 deletions tests/Integration/CommercialRomTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ final class CommercialRomTest extends TestCase
{
private const ROM_BASE_PATH = __DIR__ . '/../../third_party/roms/commerical';

/**
* Test duration in frames
* 5 minutes at 60 FPS = 18,000 frames
* We'll use shorter durations adjusted for current performance (~25-30 FPS)
*/
private const TEST_DURATION_FRAMES = 3000;

/**
* Timeout in seconds
* At ~25 FPS, 3000 frames takes ~120 seconds
Expand Down Expand Up @@ -137,6 +130,7 @@ public static function commercialRomProvider(): array
* Test loading ROMs without running them (quick sanity check)
*
* @dataProvider commercialRomProvider
* @doesNotPerformAssertions
*/
public function testRomLoads(string $romName, string $romPath, int $framesToRun): void
{
Expand All @@ -148,7 +142,7 @@ public function testRomLoads(string $romName, string $romPath, int $framesToRun)

try {
$emulator->loadRom($romPath);
$this->assertTrue(true, "{$romName} loaded successfully");
// Test passes if no exception is thrown
} catch (\Exception $e) {
$this->fail("Failed to load ROM {$romName}: {$e->getMessage()}");
}
Expand Down