Testsuite: refactor OCaml handling

Instead of using a dedicated machinery to automatically skip tests
requiring an OCaml toolchain, use the standard "control" mechanism from
e3-testsuite.

TN: S521-024
This commit is contained in:
Pierre-Marie de Rodat
2022-03-22 09:56:03 +00:00
parent 1bc68bb5c8
commit dead9ff788
3 changed files with 4 additions and 11 deletions

View File

@@ -2,7 +2,7 @@ import os
import os.path
from e3.testsuite.control import YAMLTestControlCreator
from e3.testsuite.driver.classic import TestAbortWithError, TestSkip
from e3.testsuite.driver.classic import TestAbortWithError
from e3.testsuite.driver.diff import DiffTestDriver, PatternSubstitute
from drivers.valgrind import valgrind_cmd
@@ -17,15 +17,6 @@ class BaseDriver(DiffTestDriver):
def test_control_creator(self):
return YAMLTestControlCreator(self.env.control_condition_env)
def set_up(self):
super().set_up()
if (
self.test_env.get('require_ocaml', False) and
self.env.options.disable_ocaml
):
raise TestSkip('Test requires OCaml')
@property
def output_refiners(self):
# RA22-015: Line numbers for Python DSL diagnostics vary depending on

View File

@@ -1,3 +1,4 @@
driver: python
require_ocaml: True
encoding: utf-8
control:
- [SKIP, "not has_ocaml", "OCaml support required"]

View File

@@ -106,6 +106,7 @@ class LangkitTestsuite(Testsuite):
self.env.rewrite_baselines = args.rewrite
self.env.control_condition_env = {
'restricted_env': args.restricted_env,
'has_ocaml': not args.disable_ocaml,
}
if args.coverage: