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', 'exclude' => 'optional regex | list', - )); + ) + $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'.", + '.arcunit', + $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(