Update for newer base libraries, improves error messages.
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Deukhoofd 2021-10-30 16:08:42 +02:00
parent 7342cf8a56
commit 42080a3c95
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
5 changed files with 10 additions and 9 deletions

View File

@ -21,7 +21,6 @@ endif ()
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp extern/AngelscriptDebugger/src/*.cpp) file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp extern/AngelscriptDebugger/src/*.cpp)
add_executable(PokemonScriptTester ${SRC_FILES}) add_executable(PokemonScriptTester ${SRC_FILES})
target_precompile_headers(PokemonScriptTester PUBLIC src/Precompiled.hxx)
add_definitions(-DLEVEL_U8) add_definitions(-DLEVEL_U8)
SET(_LINKS -static pkmnLib) SET(_LINKS -static pkmnLib)

View File

@ -40,6 +40,8 @@ function(include_pkmnlib)
execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include) execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include)
execute_process(COMMAND ln -s ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/src/pkmnlib/src execute_process(COMMAND ln -s ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/src/pkmnlib/src
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include/PkmnLib) ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include/PkmnLib)
execute_process(COMMAND ln -s ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/src/pkmnlib/extern
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include/extern)
execute_process(COMMAND cp -r ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/src/pkmnlib/extern execute_process(COMMAND cp -r ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/src/pkmnlib/extern
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include/PkmnLib/extern) ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include/PkmnLib/extern)

View File

@ -1,6 +0,0 @@
#ifndef POKEMONSCRIPTTESTER_PRECOMPILED_HXX
#define POKEMONSCRIPTTESTER_PRECOMPILED_HXX
#include <PkmnLib/Precompiled.hxx>
#endif // POKEMONSCRIPTTESTER_PRECOMPILED_HXX

View File

@ -25,7 +25,7 @@ class MiscMockFunctions {
auto move = Globals::Library.GetValue()->GetMoveLibrary()->TryGet(moveName); auto move = Globals::Library.GetValue()->GetMoveLibrary()->TryGet(moveName);
if (!move.has_value()) { if (!move.has_value()) {
return {}; THROW("Unknown move: " << moveName);
} }
auto learnedMove = auto learnedMove =
new PkmnLib::Battling::LearnedMove(move.value(), CreatureLib::Battling::AttackLearnMethod::Unknown); new PkmnLib::Battling::LearnedMove(move.value(), CreatureLib::Battling::AttackLearnMethod::Unknown);

View File

@ -26,7 +26,13 @@ public:
_env->CollectGarbage(); _env->CollectGarbage();
if (e == asEXECUTION_EXCEPTION) { if (e == asEXECUTION_EXCEPTION) {
_errorMessage = ctx->GetExceptionString(); std::stringstream error;
const char* exceptionSection = "";
int exceptionColumn = 0;
auto exceptionLine = ctx->GetExceptionLineNumber(&exceptionColumn, &exceptionSection);
error << "[" << exceptionSection << ":" << exceptionLine << "," << exceptionColumn << "] "
<< ctx->GetExceptionString();
_errorMessage = error.str();
_result = TestResult::Failed; _result = TestResult::Failed;
ctx->PopState(); ctx->PopState();
return; return;