Autoload para pruebas

This commit is contained in:
Juan Pablo Vial
2025-04-29 23:18:55 -04:00
parent 4bd5fe16df
commit f5f1482b7a

View File

@ -147,6 +147,21 @@ class TestBootstrap
}
}
spl_autoload_register(function($className) {
$baseTestPath = __DIR__ . "/tests";
$namespaceMap = [
"ProVM\\Integration\\" => "{$baseTestPath}/integration",
"ProVM\\Unit\\" => "{$baseTestPath}/unit/src",
"ProVM\\Performance\\" => "{$baseTestPath}/performance",
];
foreach ($namespaceMap as $namespace => $path) {
if (str_starts_with($className, $namespace)) {
require str_replace($namespace, "{$path}/", $className) . ".php";
return;
}
}
});
$bootstrap = new TestBootstrap($_ENV);
Benchmark::execute([$bootstrap, 'run']);
Benchmark::print();