News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

PR#583 - Script API + automated tests

Started by ceeac, October 30, 2022, 08:52:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ceeac

PR#583 merges the script API and the automated test suite from Standard.
However, about half of the tests are still disabled because of bugs in Extended, or because the functionality is different between Standard and Extended. The tests for the latter case still need to be fixed before they can be re-enabled.

Additionally, a C++14 compiler is now required to compile.

jamespetts

Thank you for this work. Can I check whether you have tested whether this merges cleanly with the ex-15 branch? It is important that any new patches merge cleanly with that branch before they can be integrated.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ceeac

No, it does not, unfortunately - Should I rebase onto the ex-15 branch?

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ceeac

I have rebased the PR onto the ex-15 branch now.

jamespetts

Thank you for this. Unfortunately, I am unable to compile this, even after reverting the change for the custom miniupnpc file locations. I get the following linker errors in Visual Studio:

Build started...
1>------ Build started: Project: Simutrans-Extended, Configuration: Debug x64 ------
1>git : Not a git repository warning GitNR1: Git output not valid! Check if the folder is actually versioned. A revision file already exists and its revision number won't be updated. Make sure the revision number is correct or you won't be able to play online with this build.
1>LINK : warning LNK4300: ignoring '/INCREMENTAL' because input module contains ASAN metadata
1>libbz2.lib(bzlib.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>  Creating library .\simutrans\Simutrans-Extended-Debug.lib and object .\simutrans\Simutrans-Extended-Debug.exp
1>api_line.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_init>::push(struct SQVM *,class script_api::call_tool_init)" (?push@?$param@Vcall_tool_init@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_init@2@@Z)
1>api_map_objects.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_init>::push(struct SQVM *,class script_api::call_tool_init)" (?push@?$param@Vcall_tool_init@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_init@2@@Z)
1>api_player.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_init>::push(struct SQVM *,class script_api::call_tool_init)" (?push@?$param@Vcall_tool_init@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_init@2@@Z)
1>api_settings.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_init>::push(struct SQVM *,class script_api::call_tool_init)" (?push@?$param@Vcall_tool_init@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_init@2@@Z)
1>api_city.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_init>::push(struct SQVM *,class script_api::call_tool_init)" (?push@?$param@Vcall_tool_init@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_init@2@@Z)
1>api_convoy.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_init>::push(struct SQVM *,class script_api::call_tool_init)" (?push@?$param@Vcall_tool_init@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_init@2@@Z)
1>api_factory.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_init>::push(struct SQVM *,class script_api::call_tool_init)" (?push@?$param@Vcall_tool_init@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_init@2@@Z)
1>api_halt.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_init>::push(struct SQVM *,class script_api::call_tool_init)" (?push@?$param@Vcall_tool_init@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_init@2@@Z)
1>api_city.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_work>::push(struct SQVM *,class script_api::call_tool_work)" (?push@?$param@Vcall_tool_work@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_work@2@@Z)
1>api_gui.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_work>::push(struct SQVM *,class script_api::call_tool_work)" (?push@?$param@Vcall_tool_work@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_work@2@@Z)
1>api_map_objects.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_work>::push(struct SQVM *,class script_api::call_tool_work)" (?push@?$param@Vcall_tool_work@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_work@2@@Z)
1>api_tiles.obj : error LNK2001: unresolved external symbol "public: static __int64 __cdecl script_api::param<class script_api::call_tool_work>::push(struct SQVM *,class script_api::call_tool_work)" (?push@?$param@Vcall_tool_work@script_api@@@script_api@@SA_JPEAUSQVM@@Vcall_tool_work@2@@Z)
1>api_player.obj : error LNK2001: unresolved external symbol "class script_api::call_tool_init __cdecl script_api::command_rename(class player_t *,char,unsigned int,char const *)" (?command_rename@script_api@@YA?AVcall_tool_init@1@PEAVplayer_t@@DIPEBD@Z)
1>api_city.obj : error LNK2001: unresolved external symbol "class script_api::call_tool_init __cdecl script_api::command_rename(class player_t *,char,unsigned int,char const *)" (?command_rename@script_api@@YA?AVcall_tool_init@1@PEAVplayer_t@@DIPEBD@Z)
1>api_convoy.obj : error LNK2001: unresolved external symbol "class script_api::call_tool_init __cdecl script_api::command_rename(class player_t *,char,unsigned int,char const *)" (?command_rename@script_api@@YA?AVcall_tool_init@1@PEAVplayer_t@@DIPEBD@Z)
1>api_halt.obj : error LNK2001: unresolved external symbol "class script_api::call_tool_init __cdecl script_api::command_rename(class player_t *,char,unsigned int,char const *)" (?command_rename@script_api@@YA?AVcall_tool_init@1@PEAVplayer_t@@DIPEBD@Z)
1>api_line.obj : error LNK2001: unresolved external symbol "class script_api::call_tool_init __cdecl script_api::command_rename(class player_t *,char,unsigned int,char const *)" (?command_rename@script_api@@YA?AVcall_tool_init@1@PEAVplayer_t@@DIPEBD@Z)
1>api_factory.obj : error LNK2001: unresolved external symbol "class script_api::call_tool_init __cdecl script_api::command_rename(class player_t *,char,class koord3d,char const *)" (?command_rename@script_api@@YA?AVcall_tool_init@1@PEAVplayer_t@@DVkoord3d@@PEBD@Z)
1>api_map_objects.obj : error LNK2001: unresolved external symbol "class script_api::call_tool_init __cdecl script_api::command_rename(class player_t *,char,class koord3d,char const *)" (?command_rename@script_api@@YA?AVcall_tool_init@1@PEAVplayer_t@@DVkoord3d@@PEBD@Z)
1>api_param.obj : error LNK2001: unresolved external symbol "public: static void * __cdecl script_api::param<class tool_t *>::tag(void)" (?tag@?$param@PEAVtool_t@@@script_api@@SAPEAXXZ)
1>export_objs.obj : error LNK2001: unresolved external symbol "void __cdecl export_commands(struct SQVM *)" (?export_commands@@YAXPEAUSQVM@@@Z)
1>export_objs.obj : error LNK2001: unresolved external symbol "void __cdecl export_pathfinding(struct SQVM *)" (?export_pathfinding@@YAXPEAUSQVM@@@Z)
1>scenario.obj : error LNK2001: unresolved external symbol "public: static class script_vm_t * __cdecl script_loader_t::start_vm(char const *,char const *,char const *,bool)" (?start_vm@script_loader_t@@SAPEAVscript_vm_t@@PEBD00_N@Z)
1>scenario.obj : error LNK2001: unresolved external symbol "public: static void __cdecl script_loader_t::load_compatibility_script(class script_vm_t *)" (?load_compatibility_script@script_loader_t@@SAXPEAVscript_vm_t@@@Z)
1>.\simutrans\Simutrans-Extended-debug.exe : fatal error LNK1120: 9 unresolved externals
1>Done building project "Simutrans-Extended.vcxproj" -- FAILED.

This looks as though there is a missing .cc file somewhere, but I cannot find any additional files that I should be including.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ceeac

Yes, there were some files that were not added to the vcxproj file; this should hopefully be fixed now.

jamespetts

Quote from: ceeac on November 06, 2022, 05:01:15 PMYes, there were some files that were not added to the vcxproj file; this should hopefully be fixed now.

Excellent, thank you. This now seems to work. I have incorporated this.

I note for reference that we are now targetting C++14 rather than the previous C++11.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.