ncc/tests/autoload.php

12 lines
608 B
PHP
Raw Normal View History

2022-04-16 18:07:58 -04:00
<?php
2022-09-26 17:45:04 -04:00
$BuildDirectory = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'build';
$AutoloadPath = $BuildDirectory . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'autoload.php';
2022-09-26 17:45:04 -04:00
if(!file_exists($BuildDirectory) || !is_dir($BuildDirectory))
throw new RuntimeException('Build directory does not exist, to run tests you must build the project.');
2022-09-26 17:45:04 -04:00
if(!file($AutoloadPath) || is_file($AutoloadPath))
throw new RuntimeException('Autoload file does not exist in \'' . $BuildDirectory .'\', to run tests you must build the project.');
require($AutoloadPath);