Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14871887
D12689.id30464.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12689.id30464.diff
View Options
diff --git a/src/unit/engine/PhutilUnitTestEngine.php b/src/unit/engine/PhutilUnitTestEngine.php
--- a/src/unit/engine/PhutilUnitTestEngine.php
+++ b/src/unit/engine/PhutilUnitTestEngine.php
@@ -17,16 +17,21 @@
}
if (!$run_tests) {
- throw new ArcanistNoEffectException('No tests to run.');
+ throw new ArcanistNoEffectException(pht('No tests to run.'));
}
$enable_coverage = $this->getEnableCoverage();
+
if ($enable_coverage !== false) {
if (!function_exists('xdebug_start_code_coverage')) {
if ($enable_coverage === true) {
throw new ArcanistUsageException(
- 'You specified --coverage but xdebug is not available, so '.
- 'coverage can not be enabled for PhutilUnitTestEngine.');
+ pht(
+ 'You specified %s but %s is not available, so '.
+ 'coverage can not be enabled for %s.',
+ '--coverage',
+ 'XDebug',
+ __CLASS__));
}
} else {
$enable_coverage = true;
@@ -134,17 +139,15 @@
// does not actually lie within the library.
continue;
} else if (is_file($path) && preg_match('/\b__tests__\b/', $path)) {
-
$look_here[$library_name.':'.$library_path] = array(
'library' => $library_name,
'path' => $library_path,
);
} else {
do {
- var_dump($library_path);
$look_here[$library_name.':'.$library_path] = array(
'library' => $library_name,
- 'path' => $library_path,
+ 'path' => $library_path == $library_root ? '' : $library_path,
);
$library_path = dirname($library_path);
} while ($library_path != '.' && $library_path == $library_root);
@@ -159,7 +162,7 @@
// "infrastructure/". However, "infrastructure/concrete/rebar/__tests__/"
// defines more specific tests that run only when rebar/ (or some
// subdirectory) changes.
-var_dump($look_here);
+
$run_tests = array();
foreach ($look_here as $path_info) {
$library = $path_info['library'];
@@ -168,7 +171,7 @@
$symbols = id(new PhutilSymbolLoader())
->setType('class')
->setLibrary($library)
- ->setPathPrefix(($path ? $path.'/' : '').'__tests__/')
+ ->setPathPrefix($path)
->setAncestorClass('ArcanistPhutilTestCase')
->setConcreteOnly(true)
->selectAndLoadSymbols();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 9, 4:16 AM (57 m, 48 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7105480
Default Alt Text
D12689.id30464.diff (2 KB)
Attached To
Mode
D12689: Allow PhutilUnitTestEngine to execute tests from a single path
Attached
Detach File
Event Timeline
Log In to Comment