Adopt generator based interface by mapgen tests #7059

Merged
phosit merged 1 commits from phosit/0ad:map_generator into main 2024-09-25 20:15:48 +02:00
Member

This put the tests more in line with actual mapgen scripts.

Continuation of https://code.wildfiregames.com/D5320

This put the tests more in line with actual mapgen scripts. Continuation of https://code.wildfiregames.com/D5320
phosit added 1 commit 2024-09-19 18:44:03 +02:00
Adopt generator based interface by mapgen tests
Some checks failed
0ad-freebsd/pipeline/pr-main This commit looks good
checkrefs / checkrefs (pull_request) Successful in 1m46s
pre-commit / build (pull_request) Successful in 1m58s
0ad-windows/pipeline/pr-main There was a failure building this commit
0ad-linux/pipeline/pr-main This commit looks good
0ad-macos/pipeline/pr-main This commit looks good
9fb9d26dcc
This put the tests more in line with actual mapgen scripts.
phosit requested review from vladislavbelov 2024-09-19 18:44:04 +02:00
phosit requested review from smiley 2024-09-19 18:44:04 +02:00
phosit requested review from marder 2024-09-19 18:44:04 +02:00
Owner
E:\Jenkins\workspace\vs2017>cd binaries\system   && test_dbg.exe  1>cxxtest-debug.xml 
Assertion failure: (mNext == this) == (mPrev == this), at c:/Dev/Perso/0ad-git/libraries/source/spidermonkey/mozjs-91.13.1/build-debug/dist/include\mozilla/LinkedList.h:289
### ERROR: SymInitialize: The parameter is incorrect.
``` E:\Jenkins\workspace\vs2017>cd binaries\system && test_dbg.exe 1>cxxtest-debug.xml Assertion failure: (mNext == this) == (mPrev == this), at c:/Dev/Perso/0ad-git/libraries/source/spidermonkey/mozjs-91.13.1/build-debug/dist/include\mozilla/LinkedList.h:289 ### ERROR: SymInitialize: The parameter is incorrect. ```
Author
Member

Yes i noticed. That's the same error we had at D5320.

Yes i noticed. That's the same error we had at [D5320](https://code.wildfiregames.com/D5320#227338).
Owner

Here is the stack trace:

mozjs91-ps-debug.dll!mozilla::LinkedListElement<JS::PersistentRooted<JS::detail::RootListEntry *>>::isInList() Ligne 289
mozjs91-ps-debug.dll!mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>::isEmpty() Ligne 501
mozjs91-ps-debug.dll!mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>::~LinkedList() Ligne 439
mozjs91-ps-debug.dll!mozilla::Array<mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>,15>::~Array() Ligne 24
mozjs91-ps-debug.dll!mozilla::EnumeratedArray<JS::RootKind,JS::RootKind::Limit,mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>>::~EnumeratedArray() Ligne 43
mozjs91-ps-debug.dll!js::ProtectedData<js::CheckMainThread<js::AllowedHelperThread::None>,mozilla::EnumeratedArray<JS::RootKind,JS::RootKind::Limit,mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>>>::~ProtectedData() Ligne 77
mozjs91-ps-debug.dll!js::ProtectedDataNoCheckArgs<js::CheckMainThread<js::AllowedHelperThread::None>,mozilla::EnumeratedArray<JS::RootKind,JS::RootKind::Limit,mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>>>::~ProtectedDataNoCheckArgs() Ligne 170
mozjs91-ps-debug.dll!JSRuntime::~JSRuntime() Ligne 195
mozjs91-ps-debug.dll!js_delete_poison<JSRuntime>(const JSRuntime * p) Ligne 561
mozjs91-ps-debug.dll!js::DestroyContext(JSContext * cx) Ligne 243
mozjs91-ps-debug.dll!JS_DestroyContext(JSContext * cx) Ligne 408
test_dbg.exe!ScriptContext::~ScriptContext() Ligne 142
[External code]
test_dbg.exe!MiscSetup::tearDownWorld() Ligne 87
test_dbg.exe!CxxTest::RealWorldDescription::tearDown() Ligne 340
test_dbg.exe!CxxTest::TestRunner::runWorld() Ligne 75
test_dbg.exe!CxxTest::TestRunner::runAllTests(CxxTest::TestListener & listener) Ligne 42
test_dbg.exe!CxxTest::ErrorFormatter::run() Ligne 63
test_dbg.exe!CxxTest::Main<CxxTest::ErrorPrinter>(CxxTest::ErrorPrinter & tmp, int argc, char * * argv) Ligne 148
test_dbg.exe!SDL_main(int argc, char * * argv) Ligne 20
test_dbg.exe!main_getcmdline() Ligne 74
[External code]
Here is the stack trace: ``` mozjs91-ps-debug.dll!mozilla::LinkedListElement<JS::PersistentRooted<JS::detail::RootListEntry *>>::isInList() Ligne 289 mozjs91-ps-debug.dll!mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>::isEmpty() Ligne 501 mozjs91-ps-debug.dll!mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>::~LinkedList() Ligne 439 mozjs91-ps-debug.dll!mozilla::Array<mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>,15>::~Array() Ligne 24 mozjs91-ps-debug.dll!mozilla::EnumeratedArray<JS::RootKind,JS::RootKind::Limit,mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>>::~EnumeratedArray() Ligne 43 mozjs91-ps-debug.dll!js::ProtectedData<js::CheckMainThread<js::AllowedHelperThread::None>,mozilla::EnumeratedArray<JS::RootKind,JS::RootKind::Limit,mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>>>::~ProtectedData() Ligne 77 mozjs91-ps-debug.dll!js::ProtectedDataNoCheckArgs<js::CheckMainThread<js::AllowedHelperThread::None>,mozilla::EnumeratedArray<JS::RootKind,JS::RootKind::Limit,mozilla::LinkedList<JS::PersistentRooted<JS::detail::RootListEntry *>>>>::~ProtectedDataNoCheckArgs() Ligne 170 mozjs91-ps-debug.dll!JSRuntime::~JSRuntime() Ligne 195 mozjs91-ps-debug.dll!js_delete_poison<JSRuntime>(const JSRuntime * p) Ligne 561 mozjs91-ps-debug.dll!js::DestroyContext(JSContext * cx) Ligne 243 mozjs91-ps-debug.dll!JS_DestroyContext(JSContext * cx) Ligne 408 test_dbg.exe!ScriptContext::~ScriptContext() Ligne 142 [External code] test_dbg.exe!MiscSetup::tearDownWorld() Ligne 87 test_dbg.exe!CxxTest::RealWorldDescription::tearDown() Ligne 340 test_dbg.exe!CxxTest::TestRunner::runWorld() Ligne 75 test_dbg.exe!CxxTest::TestRunner::runAllTests(CxxTest::TestListener & listener) Ligne 42 test_dbg.exe!CxxTest::ErrorFormatter::run() Ligne 63 test_dbg.exe!CxxTest::Main<CxxTest::ErrorPrinter>(CxxTest::ErrorPrinter & tmp, int argc, char * * argv) Ligne 148 test_dbg.exe!SDL_main(int argc, char * * argv) Ligne 20 test_dbg.exe!main_getcmdline() Ligne 74 [External code] ```
phosit force-pushed map_generator from 9fb9d26dcc to 737a4549fd 2024-09-22 11:58:40 +02:00 Compare
phosit force-pushed map_generator from 737a4549fd to 201d215f29 2024-09-22 12:15:03 +02:00 Compare
Stan reviewed 2024-09-22 13:06:12 +02:00
@ -63,4 +44,0 @@
{
var g_MapSettings = { "Size": 320, "CircularMap": true };
var g_Map = new RandomMap(0, "blackness");
Owner

Might be nice to run eslint locally to see if it yells.

Might be nice to run eslint locally to see if it yells.
Owner

To run it you need node. See https://github.com/0ad/0ad/blob/master/build/jenkins/dockerfiles/lint.Dockerfile

Then you need to install the deps

$ npm install -g eslint@8.57.0 eslint-plugin-brace-rules

Then lint a file:

$ eslint -c build/arclint/configs/eslintrc.json build/arclint/configs/eslintrc.json binaries/data/mods/public/maps/random/tests/test_DiskPlacer.js

If it stills complains about the missing plugin you can run

$ npm install eslint-plugin-brace-rules@latest --save-dev

I had no chance making it work with the latest eslint 9+ version last time i checked.

To run it you need node. See https://github.com/0ad/0ad/blob/master/build/jenkins/dockerfiles/lint.Dockerfile Then you need to install the deps ```sh $ npm install -g eslint@8.57.0 eslint-plugin-brace-rules ``` Then lint a file: ```sh $ eslint -c build/arclint/configs/eslintrc.json build/arclint/configs/eslintrc.json binaries/data/mods/public/maps/random/tests/test_DiskPlacer.js ``` If it stills complains about the missing plugin you can run ```sh $ npm install eslint-plugin-brace-rules@latest --save-dev ``` I had no chance making it work with the latest eslint 9+ version last time i checked.
Author
Member

There are only prefer-const warnings, which are unrelated and should be fixed in an other commit.

There are only `prefer-const` warnings, which are unrelated and should be fixed in an other commit.
Author
Member

Here is the stack trace:

Thanks a lot. Also for the time at the weekend when you searched which change introduced the build failure.

> Here is the stack trace: Thanks a lot. Also for the time at the weekend when you searched which change introduced the build failure.
phosit merged commit a84b5a61ed into main 2024-09-25 20:15:48 +02:00
phosit deleted branch map_generator 2024-09-25 20:15:48 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: 0ad/0ad#7059
No description provided.