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 {
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 = []
cmdParams << new File(rootDir, 'hlds.exe').absolutePath
cmdParams.addAll(info.hldsArgs)
if (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 sout = new StringBuffer()

View File

@ -37,23 +37,19 @@ configurations {
}
dependencies {
//regamedll_tests 'regamedll.testdemos:cstrike-fulltests-2:2.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'
regamedll_tests 'regamedll.testdemos:cstrike-basic:1.0'
}
project.ext.dep_cppunitlite = project(':dep/cppunitlite')
void createIntergrationTestTask(NativeBinarySpec b) {
boolean regamedllFixes = b.flavor.name.contains('regamedllFixes')
boolean mpLib = b.name.toLowerCase().contains('mp')
if (!(b instanceof SharedLibraryBinarySpec)) return
if (!GradleCppUtils.windows) return
if (regamedllFixes) return
if (!mpLib) return
String unitTestTask = b.hasProperty('cppUnitTestTask') ? b.cppUnitTestTask : null
@ -64,18 +60,19 @@ void createIntergrationTestTask(NativeBinarySpec b) {
testDemos = project.configurations.regamedll_tests
testFor = b
//inputs/outputs for up-to-date check
inputs.files testDemos.files
outputs.dir regamedllTestLogs
//inputs/outputs for up-to-date check
inputs.files testDemos.files
outputs.dir regamedllTestLogs
//dependencies on test executable
if (unitTestTask) {
dependsOn unitTestTask
}
//dependencies on test executable
if (unitTestTask) {
dependsOn unitTestTask
}
postExtractAction {
def binaryOutFile = GradleCppUtils.getBinaryOutputFile(b)
GradleCppUtils.copyFile(binaryOutFile, new File(regamedllImageRoot, binaryOutFile.name), true)
postExtractAction {
def binaryOutFile = GradleCppUtils.getBinaryOutputFile(b)
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++'
}
if (mpLib && GradleCppUtils.windows && !unitTestExecutable)
{
if (mpLib && GradleCppUtils.windows && !unitTestExecutable) {
cfg.linkerOptions.definitionFile = "${projectDir}\\msvc\\mp.def";
}
if (!unitTestExecutable)
{
if (!mpLib)
{
cfg.singleDefines 'HOOK_GAMEDLL'
}
}
else
{
if (unitTestExecutable) {
cfg.singleDefines 'REGAMEDLL_UNIT_TESTS'
} else if (!mpLib) {
cfg.singleDefines 'HOOK_GAMEDLL'
}
if (regamedllFixes)
{
if (regamedllFixes) {
cfg.singleDefines 'REGAMEDLL_FIXES', 'REGAMEDLL_CHECKS', 'REGAMEDLL_ADD', 'NDEBUG'
} else {
cfg.singleDefines 'PLAY_GAMEDLL'
}
ToolchainConfigUtils.apply(project, cfg, b)
@ -243,7 +234,6 @@ class RegamedllSrc {
}
}
model {
buildTypes {
debug

View File

@ -646,7 +646,7 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
else
{
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;
area->SetPlace(TheCSBots()->GetNavPlace());
return true;
}

View File

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