Skip to content

Commit

Permalink
Merge pull request #1453 from Dahlgren/feature/spawn-unit-tests
Browse files Browse the repository at this point in the history
Use execVM for all unit tests
  • Loading branch information
commy2 authored May 17, 2021
2 parents 5821b45 + 35b5260 commit 72d5c2a
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 38 deletions.
5 changes: 2 additions & 3 deletions addons/arrays/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ SCRIPT(test-arrays);
LOG("=== Testing Arrays ===");

{
call compile preprocessFileLineNumbers format ["\x\cba\addons\arrays\test_%1.sqf", _x];
private _test = execVM format ["\x\cba\addons\arrays\test_%1.sqf", _x];
waitUntil { scriptDone _test };
} forEach TESTS;

nil;
5 changes: 2 additions & 3 deletions addons/common/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SCRIPT(test-common);
LOG("=== Testing Common ===");

{
call compile preprocessFileLineNumbers format ["\x\cba\addons\common\test_%1.sqf", _x];
private _test = execVM format ["\x\cba\addons\common\test_%1.sqf", _x];
waitUntil { scriptDone _test };
} forEach TESTS;

nil;
2 changes: 1 addition & 1 deletion addons/common/test_config.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
SCRIPT(test_config);

// 0 spawn compile preprocessFileLineNumbers "\x\cba\addons\common\test_config.sqf";
// execVM "\x\cba\addons\common\test_config.sqf";

private ["_funcName", "_result"];

Expand Down
2 changes: 1 addition & 1 deletion addons/common/test_inventory.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
SCRIPT(test_inventory);

// 0 spawn compile preprocessFileLineNumbers "\x\cba\addons\common\test_inventory.sqf";
// execVM "\x\cba\addons\common\test_inventory.sqf";

// Note: test requires a player with space in inventory

Expand Down
2 changes: 1 addition & 1 deletion addons/common/test_ret.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
SCRIPT(test_ret);

// 0 spawn compile preprocessFileLineNumbers "\x\cba\addons\common\test_ret.sqf";
// execVM "\x\cba\addons\common\test_ret.sqf";

private ["_funcName", "_result"];

Expand Down
2 changes: 1 addition & 1 deletion addons/common/test_weaponComponents.sqf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 0 spawn compile preprocessFileLineNumbers "\x\cba\addons\common\test_weaponComponents.sqf";
// execVM "\x\cba\addons\common\test_weaponComponents.sqf";

#define LOGF diag_log text format
#define TESTEXP if (!isNil "_result" && {_result isEqualTo _expected}) then {LOGF ["TEST: OK - %1 result", _result]} else {LOGF ["TEST: FAIL - %1 result; %2 expected", _result, _expected]}
Expand Down
5 changes: 2 additions & 3 deletions addons/diagnostic/fnc_test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ DEFAULT_PARAM(1,_component,"main");

LOG('===== STARTING TESTS =====');

call compile preprocessFileLineNumbers format ["\x\%1\addons\%2\test.sqf", _addon, _component];
private _test = execVM format ["\x\%1\addons\%2\test.sqf", _addon, _component];
waitUntil { scriptDone _test };

LOG('===== COMPLETED TESTS =====');

nil;
5 changes: 2 additions & 3 deletions addons/diagnostic/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SCRIPT(test-diagnostic);
LOG("=== Testing Diagnostic ===");

{
call compile preprocessFileLineNumbers format ["\x\cba\addons\diagnostic\test_%1.sqf", _x];
private _test = execVM format ["\x\cba\addons\diagnostic\test_%1.sqf", _x];
waitUntil { scriptDone _test };
} forEach TESTS;

nil;
5 changes: 2 additions & 3 deletions addons/events/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SCRIPT(test-events);
LOG("=== Testing Events ===");

{
0 spawn compile preprocessFileLineNumbers format ["\x\cba\addons\events\test_%1.sqf", _x];
private _test = execVM format ["\x\cba\addons\events\test_%1.sqf", _x];
waitUntil { scriptDone _test };
} forEach TESTS;

nil
5 changes: 2 additions & 3 deletions addons/hashes/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SCRIPT(test-hashes);
LOG("=== Testing Hashes ===");

{
0 spawn compile preprocessFileLineNumbers format ["\x\cba\addons\hashes\test_%1.sqf", _x];
private _test = execVM format ["\x\cba\addons\hashes\test_%1.sqf", _x];
waitUntil { scriptDone _test };
} forEach TESTS;

nil
5 changes: 2 additions & 3 deletions addons/jr/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SCRIPT(test-jr);
LOG("=== Testing JR ===");

{
call compile preprocessFileLineNumbers format ["\x\cba\addons\jr\test_%1.sqf", _x];
private _test = execVM format ["\x\cba\addons\jr\test_%1.sqf", _x];
waitUntil { scriptDone _test };
} forEach TESTS;

nil;
5 changes: 2 additions & 3 deletions addons/main/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SCRIPT(test);
LOG("===--- Testing ---===");

{
call compile preprocessFileLineNumbers format ["\x\cba\addons\%1\test.sqf", _x];
private _test = execVM format ["\x\cba\addons\%1\test.sqf", _x];
waitUntil { scriptDone _test };
} forEach CATEGORIES;

nil;
5 changes: 2 additions & 3 deletions addons/network/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SCRIPT(test-network);
LOG("=== Testing Network ===");

{
call compile preprocessFileLineNumbers format ["\x\cba\addons\network\test_%1.sqf", _x];
private _test = execVM format ["\x\cba\addons\network\test_%1.sqf", _x];
waitUntil { scriptDone _test };
} forEach TESTS;

nil;
2 changes: 1 addition & 1 deletion addons/network/test_network.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
SCRIPT(test_network);

// 0 spawn compile preprocessFileLineNumbers "\x\cba\addons\network\test_network.sqf";
// execVM "\x\cba\addons\network\test_network.sqf";
// test has to be done with an existing "player" object (not 3den!!)

private ["_funcName", "_result"];
Expand Down
5 changes: 2 additions & 3 deletions addons/strings/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SCRIPT(test-strings);
LOG("=== Testing Strings ===");

{
call compile preprocessFileLineNumbers format ["\x\cba\addons\strings\test_%1.sqf", _x];
private _test = execVM format ["\x\cba\addons\strings\test_%1.sqf", _x];
waitUntil { scriptDone _test };
} forEach TESTS;

nil
5 changes: 2 additions & 3 deletions addons/vectors/test.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SCRIPT(test-vectors);
LOG("=== Testing Vectors ===");

{
call compile preprocessFileLineNumbers format ["\x\cba\addons\vectors\test_%1.sqf", _x];
private _test = execVM format ["\x\cba\addons\vectors\test_%1.sqf", _x];
waitUntil { scriptDone _test };
} forEach TESTS;

nil;

0 comments on commit 72d5c2a

Please sign in to comment.