Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15490268
D18815.id45147.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
D18815.id45147.diff
View Options
diff --git a/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php b/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php
--- a/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php
+++ b/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php
@@ -74,6 +74,17 @@
}
$test_engine = clone $test_engines[$type];
+ $more = $test_engine->getEngineConfigurationOptions();
+
+ foreach ($more as $key => $option_spec) {
+ PhutilTypeSpec::checkMap(
+ $option_spec,
+ array(
+ 'type' => 'string',
+ 'help' => 'string',
+ ));
+ $more[$key] = $option_spec['type'];
+ }
} else {
// We'll raise an error below about the invalid "type" key.
// TODO: Can we just do the type check first, and simplify this a bit?
@@ -87,7 +98,7 @@
'type' => 'string',
'include' => 'optional regex | list<regex>',
'exclude' => 'optional regex | list<regex>',
- ));
+ ) + $more);
} catch (PhutilTypeCheckException $ex) {
throw new PhutilProxyException(
pht(
@@ -97,6 +108,22 @@
$ex);
}
+ foreach ($more as $key => $value) {
+ if (array_key_exists($key, $spec)) {
+ try {
+ $test_engine->setEngineConfigurationValue($key, $spec[$key]);
+ } catch (Exception $ex) {
+ throw new PhutilProxyException(
+ pht(
+ "Error in parsing '%s' file, in key '%s' for test engine '%s'.",
+ '.arclint',
+ $key,
+ $name),
+ $ex);
+ }
+ }
+ }
+
if ($all_paths) {
$include = (array)idx($spec, 'include', array());
$exclude = (array)idx($spec, 'exclude', array());
diff --git a/src/unit/engine/ArcanistUnitTestEngine.php b/src/unit/engine/ArcanistUnitTestEngine.php
--- a/src/unit/engine/ArcanistUnitTestEngine.php
+++ b/src/unit/engine/ArcanistUnitTestEngine.php
@@ -18,6 +18,14 @@
return null;
}
+ public function getEngineConfigurationOptions() {
+ return array();
+ }
+
+ public function setEngineConfigurationValue($key, $value) {
+ throw new Exception(pht('Incomplete implementation: %s!', $key));
+ }
+
final public function setRunAllTests($run_all_tests) {
if (!$this->supportsRunAllTests() && $run_all_tests) {
throw new Exception(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 12, 3:52 PM (2 d, 1 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7739711
Default Alt Text
D18815.id45147.diff (2 KB)
Attached To
Mode
D18815: Allow additional options in .arcunit files
Attached
Detach File
Event Timeline
Log In to Comment