forked from sebastianbergmann/phpunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sandbox for xdebug_trace of different data provider implementations
- Loading branch information
1 parent
a5a0372
commit 3b70a64
Showing
7 changed files
with
331 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
class DummyGeneratorDataProviderLoadingTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
const SIZE_SMALL = 10000; | ||
const SIZE_MEDIUM = 50000; | ||
const SIZE_LARGE = 100000; | ||
|
||
public function testFirst(): void | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
|
||
/** | ||
* @dataProvider smallProvider | ||
*/ | ||
public function testSmall1 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider smallProvider | ||
*/ | ||
public function testSmall2 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider smallProvider | ||
*/ | ||
public function testSmall3 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider mediumProvider | ||
*/ | ||
public function testMedium1 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider mediumProvider | ||
*/ | ||
public function testMedium2 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider mediumProvider | ||
*/ | ||
public function testMedium3 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider mediumProvider | ||
*/ | ||
public function testMedium4 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider mediumProvider | ||
*/ | ||
public function testMedium5 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge1 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge2 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge3 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge4 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge5 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge6 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge7 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge8 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge9 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge10 (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
public function testLast(): void | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
|
||
public function smallProvider(): array | ||
{ | ||
return [ | ||
"small 1" => [str_repeat("some string", self::SIZE_SMALL)], | ||
]; | ||
} | ||
|
||
public function mediumProvider(): array | ||
{ | ||
return [ | ||
"medium 1" => [str_repeat("some string", self::SIZE_MEDIUM)], | ||
]; | ||
} | ||
|
||
public function largeProvider(): array | ||
{ | ||
return [ | ||
"large 1" => [str_repeat("some string", self::SIZE_LARGE)], | ||
]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
class SyntheticDataProviderLoadingTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
const SIZE_SMALL = 10000; | ||
const SIZE_MEDIUM = 50000; | ||
const SIZE_LARGE = 100000; | ||
|
||
public function testFirst(): void | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
|
||
/** | ||
* @dataProvider smallProvider | ||
*/ | ||
public function testSmall (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider mediumProvider | ||
*/ | ||
public function testMedium (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
/** | ||
* @dataProvider largeProvider | ||
*/ | ||
public function testLarge (string $text): void | ||
{ | ||
$this->assertIsString($text); | ||
} | ||
|
||
public function testLast(): void | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
|
||
public function smallProvider(): array | ||
{ | ||
return [ | ||
"small 1" => [str_repeat("some string", self::SIZE_SMALL)], | ||
"small 2" => [str_repeat("some string", self::SIZE_SMALL)], | ||
"small 3" => [str_repeat("some string", self::SIZE_SMALL)], | ||
]; | ||
} | ||
|
||
public function mediumProvider(): array | ||
{ | ||
return [ | ||
"medium 1" => [str_repeat("some string", self::SIZE_MEDIUM)], | ||
"medium 2" => [str_repeat("some string", self::SIZE_MEDIUM)], | ||
"medium 3" => [str_repeat("some string", self::SIZE_MEDIUM)], | ||
"medium 4" => [str_repeat("some string", self::SIZE_MEDIUM)], | ||
"medium 5" => [str_repeat("some string", self::SIZE_MEDIUM)], | ||
]; | ||
} | ||
|
||
public function largeProvider(): array | ||
{ | ||
return [ | ||
"large 1" => [str_repeat("some string", self::SIZE_LARGE)], | ||
"large 2" => [str_repeat("some string", self::SIZE_LARGE)], | ||
"large 3" => [str_repeat("some string", self::SIZE_LARGE)], | ||
"large 4" => [str_repeat("some string", self::SIZE_LARGE)], | ||
"large 5" => [str_repeat("some string", self::SIZE_LARGE)], | ||
"large 6" => [str_repeat("some string", self::SIZE_LARGE)], | ||
"large 7" => [str_repeat("some string", self::SIZE_LARGE)], | ||
"large 8" => [str_repeat("some string", self::SIZE_LARGE)], | ||
"large 9" => [str_repeat("some string", self::SIZE_LARGE)], | ||
"large 10" => [str_repeat("some string", self::SIZE_LARGE)], | ||
]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
rm -f data_*.txt | ||
|
||
# Prefetch | ||
DP_JIT=0 \ | ||
DP_UNLOAD=0 \ | ||
./phpunit tests/sandbox/SyntheticDataprovidersTest.php | ||
|
||
awk '/TestResult->startTest[[:space:]]/{print $5}' /tmp/phpunit.xt > data_prefetch.txt | ||
|
||
# JIT only | ||
DP_JIT=1 \ | ||
DP_UNLOAD=0 \ | ||
./phpunit tests/sandbox/SyntheticDataprovidersTest.php | ||
|
||
awk '/TestResult->startTest[[:space:]]/{print $5}' /tmp/phpunit.xt > data_jit.txt | ||
|
||
# JIT with unload | ||
DP_JIT=1 \ | ||
DP_UNLOAD=1 \ | ||
./phpunit tests/sandbox/SyntheticDataprovidersTest.php | ||
|
||
awk '/TestResult->startTest[[:space:]]/{print $5}' /tmp/phpunit.xt > data_unload.txt | ||
|
||
# Simulate resource consumption of a Generator driven data provider | ||
DP_JIT=1 \ | ||
DP_UNLOAD=1 \ | ||
./phpunit tests/sandbox/DummyGeneratorDataprovidersTest.php | ||
|
||
awk '/TestResult->startTest[[:space:]]/{print $5}' /tmp/phpunit.xt > data_generator.txt |