Page MenuHomePhabricator

D18815.id45147.diff
No OneTemporary

D18815.id45147.diff

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

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)

Event Timeline