Update for newer base libraries, improves error messages.
This commit is contained in:
parent
7342cf8a56
commit
42080a3c95
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#ifndef POKEMONSCRIPTTESTER_PRECOMPILED_HXX
|
|
||||||
#define POKEMONSCRIPTTESTER_PRECOMPILED_HXX
|
|
||||||
|
|
||||||
#include <PkmnLib/Precompiled.hxx>
|
|
||||||
|
|
||||||
#endif // POKEMONSCRIPTTESTER_PRECOMPILED_HXX
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue