Use the tests demo record/player from ReHLDS.

Update version dependencies testimg HLDS for upload.
Update test map regamedll_test_map_v5
This commit is contained in:
s1lentq 2016-02-24 01:54:07 +06:00
parent 3d252fe527
commit 49de531e8c
8 changed files with 26 additions and 40 deletions

View File

@ -11,7 +11,7 @@ class RegamedllPlayTestPlugin implements Plugin<Project> {
} }
project.dependencies { project.dependencies {
regamedll_playtest_image 'regamedll.testimg:testimg:1.0' regamedll_playtest_image 'regamedll.testimg:testimg:2.0'
} }
} }
} }

View File

@ -75,12 +75,11 @@ class RegamedllDemoRunner {
def cmdParams = [] def cmdParams = []
cmdParams << new File(rootDir, 'hlds.exe').absolutePath cmdParams << new File(rootDir, 'hlds.exe').absolutePath
cmdParams.addAll(info.hldsArgs) cmdParams.addAll(info.hldsArgs)
if (info.regamedllExtraArgs) { if (info.regamedllExtraArgs) {
cmdParams.addAll(info.regamedllExtraArgs) cmdParams.addAll(info.regamedllExtraArgs)
} }
cmdParams << '--regamedll-test-play' << info.testBinFile.absolutePath cmdParams << '--rehlds-test-play' << info.testBinFile.absolutePath
def pb = new ProcessBuilder(cmdParams).redirectErrorStream(true).directory(rootDir) def pb = new ProcessBuilder(cmdParams).redirectErrorStream(true).directory(rootDir)
def sout = new StringBuffer() def sout = new StringBuffer()

View File

@ -37,23 +37,19 @@ configurations {
} }
dependencies { dependencies {
//regamedll_tests 'regamedll.testdemos:cstrike-fulltests-2:2.0' regamedll_tests 'regamedll.testdemos:cstrike-basic:1.0'
//regamedll_tests 'regamedll.testdemos:czero-ladder_hard:2.0'
//regamedll_tests 'regamedll.testdemos:cstrike-multiplayer-2:2.0'
//regamedll_tests 'regamedll.testdemos:cstrike-hostage-2:2.0'
//regamedll_tests 'regamedll.testdemos:cstrike-weapon-1:1.0'
//regamedll_tests 'regamedll.testdemos:czero-czbot_game-2:2.0'
} }
project.ext.dep_cppunitlite = project(':dep/cppunitlite') project.ext.dep_cppunitlite = project(':dep/cppunitlite')
void createIntergrationTestTask(NativeBinarySpec b) { void createIntergrationTestTask(NativeBinarySpec b) {
boolean regamedllFixes = b.flavor.name.contains('regamedllFixes') boolean regamedllFixes = b.flavor.name.contains('regamedllFixes')
boolean mpLib = b.name.toLowerCase().contains('mp')
if (!(b instanceof SharedLibraryBinarySpec)) return if (!(b instanceof SharedLibraryBinarySpec)) return
if (!GradleCppUtils.windows) return if (!GradleCppUtils.windows) return
if (regamedllFixes) return if (regamedllFixes) return
if (!mpLib) return
String unitTestTask = b.hasProperty('cppUnitTestTask') ? b.cppUnitTestTask : null String unitTestTask = b.hasProperty('cppUnitTestTask') ? b.cppUnitTestTask : null
@ -75,7 +71,8 @@ void createIntergrationTestTask(NativeBinarySpec b) {
postExtractAction { postExtractAction {
def binaryOutFile = GradleCppUtils.getBinaryOutputFile(b) def binaryOutFile = GradleCppUtils.getBinaryOutputFile(b)
GradleCppUtils.copyFile(binaryOutFile, new File(regamedllImageRoot, binaryOutFile.name), true) def binaryOutDir = new File(project.projectDir, '/_regamedllTestImg/cstrike/dlls')
GradleCppUtils.copyFile(binaryOutFile, new File(binaryOutDir, binaryOutFile.name), true)
} }
} }
@ -154,26 +151,20 @@ void setupToolchain(NativeBinarySpec b)
cfg.extraLibs 'dl', 'm', 'stdc++' cfg.extraLibs 'dl', 'm', 'stdc++'
} }
if (mpLib && GradleCppUtils.windows && !unitTestExecutable) if (mpLib && GradleCppUtils.windows && !unitTestExecutable) {
{
cfg.linkerOptions.definitionFile = "${projectDir}\\msvc\\mp.def"; cfg.linkerOptions.definitionFile = "${projectDir}\\msvc\\mp.def";
} }
if (!unitTestExecutable) if (unitTestExecutable) {
{ cfg.singleDefines 'REGAMEDLL_UNIT_TESTS'
if (!mpLib) } else if (!mpLib) {
{
cfg.singleDefines 'HOOK_GAMEDLL' cfg.singleDefines 'HOOK_GAMEDLL'
} }
}
else
{
cfg.singleDefines 'REGAMEDLL_UNIT_TESTS'
}
if (regamedllFixes) if (regamedllFixes) {
{
cfg.singleDefines 'REGAMEDLL_FIXES', 'REGAMEDLL_CHECKS', 'REGAMEDLL_ADD', 'NDEBUG' cfg.singleDefines 'REGAMEDLL_FIXES', 'REGAMEDLL_CHECKS', 'REGAMEDLL_ADD', 'NDEBUG'
} else {
cfg.singleDefines 'PLAY_GAMEDLL'
} }
ToolchainConfigUtils.apply(project, cfg, b) ToolchainConfigUtils.apply(project, cfg, b)
@ -243,7 +234,6 @@ class RegamedllSrc {
} }
} }
model { model {
buildTypes { buildTypes {
debug debug

View File

@ -646,7 +646,7 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
else else
{ {
CONSOLE_ECHO("Current place set to '%s'\n", found->GetName()); CONSOLE_ECHO("Current place set to '%s'\n", found->GetName());
m_navPlace = found->GetID(); SetNavPlace(found->GetID());
} }
} }
} }

View File

@ -3669,7 +3669,6 @@ class PlaceFloodFillFunctor
return false; return false;
area->SetPlace(TheCSBots()->GetNavPlace()); area->SetPlace(TheCSBots()->GetNavPlace());
return true; return true;
} }

View File

@ -66,12 +66,10 @@ class CSaveRestoreBuffer;
#define __MAKE_VHOOK(fname)\ #define __MAKE_VHOOK(fname)\
fname##_ fname##_
#define IMPL IMPLEMENT_ARRAY #define IMPL(var)\
#define IMPLEMENT_ARRAY(var)\
(*p##var) (*p##var)
#define IMPL_CLASS IMPLEMENT_ARRAY_CLASS #define IMPL_CLASS(baseClass,var)\
#define IMPLEMENT_ARRAY_CLASS(baseClass,var)\
(*baseClass::p##var) (*baseClass::p##var)
// refs // refs