ACE3/addons/common/functions/fnc_runTests.sqf
Dedmen Miller e2ac18a05d [WIP] Fix script errors reporting wrong line numbers (#6407)
* advanced_ballistics

* advanced_fatigue

* advanced_throwing

* ai

* aircraft

* arsenal

* atragmx

* attach

* backpacks

* ballistics

* captives

* cargo

* chemlights

* common

* concertina_wire

* cookoff

* dagr

* disarming

* disposable

* dogtags

* dragging

* explosives

* fastroping

* fcs

* finger

* frag

* gestures

* gforces

* goggles

* grenades

* gunbag

* hearing

* hitreactions

* huntir

* interact_menu

* interaction

* inventory

* kestrel4500

* laser

* laserpointer

* logistics_uavbattery

* logistics_wirecutter

* magazinerepack

* map

* map_gestures

* maptools

* markers

* medical

* medical_ai

* medical_blood

* medical_menu

* microdagr

* minedetector

* missileguidance

* missionmodules

* mk6mortar

* modules

* movement

* nametags

* nightvision

* nlaw

* optics

* optionsmenu

* overheating

* overpressure

* parachute

* pylons

* quickmount

* rangecard

* rearm

* recoil

* refuel

* reload

* reloadlaunchers

* repair

* respawn

* safemode

* sandbag

* scopes

* slideshow

* spectator

* spottingscope

* switchunits

* tacticalladder

* tagging

* trenches

* tripod

* ui

* vector

* vehiclelock

* vehicles

* viewdistance

* weaponselect

* weather

* winddeflection

* yardage450

* zeus

* arsenal defines.hpp

* optionals

* DEBUG_MODE_FULL 1

* DEBUG_MODE_FULL 2

* Manual fixes

* Add SQF Validator check for #include after block comment

* explosives fnc_openTimerUI

* fix uniqueItems
2018-09-17 14:19:29 -05:00

49 lines
1.5 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: PabstMirror
* Run test functions.
*
* Arguments:
* 0: Specific test to run (default is to run all) <STRING> (default: #all)
*
* Return Value:
* None
*
* Example:
* [] call ace_common_fnc_runTests
* ["fcs"] call ace_common_fnc_runTests
*
* Public: Yes
*/
params [["_specificTest", "#all", [""]]];
private _startTime = diag_tickTime;
private _fails = [];
private _total = 0;
INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest);
{
private _testName = configName _x;
if ((_specificTest == "#all") || {_specificTest == _testName}) then {
_total = _total + 1;
private _testFile = getText _x;
diag_log text format ["----- Starting Testing %1 [%2] -----", _testName, _testFile];
private _return = ([nil] apply (compile preProcessFileLineNumbers _testFile)) select 0;
if ((isNil "_return") || {!(_return isEqualTo true)}) then {
systemChat format ["Test [%1] Failed", _testName];
diag_log text format ["----- Finished Testing %1 [Failed] -----", _testName];
_fails pushBack _testName;
} else {
diag_log text format ["----- Finished Testing %1 [Passed] -----", _testName];
};
};
} forEach (configProperties [configFile >> "ACE_Tests"]);
INFO_1("ace_common_fnc_runTests finished in %1 ms", (1000 * (diag_tickTime - _startTime)) toFixed 1);
INFO_2("[%1 / %2] Tests Passed", (_total - (count _fails)), _total);
if (!(_fails isEqualTo [])) then {
INFO_1("Failed: %1", _fails);
};