-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unittests for item movement code #11885
Add unittests for item movement code #11885
Conversation
Rebased |
Aaaand... another rebase needed, sorry :\ |
How about a core dev reviews it first, and I rebase it after? Right now it looks quite pointless to rebase. |
Rebased and fixed the issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, makes sense, works. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one thing.
src/unittest/test_moveaction.cpp
Outdated
server_scripting.loadMod(Server::getBuiltinLuaPath() + DIR_DELIM "tests" + | ||
DIR_DELIM "helper_moveaction.lua", BUILTIN_MOD_NAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't you put helper_moveaction.lua
in a mod inside the unittests
directory similar to test_mod
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TurkeyMcMac What's the idea behind scattering the Lua files more?
#11885 (comment)
EDIT: This path will only work when the unittest is run from the build directory, that's however not guaranteed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ test helper code shouldn't be in builtin
IMO, especially given that the C++ unit tests are only optionally included in the executable. There is already precedent for putting Lua in the unittests
directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builtin
files are distributed to clients, those in unittests
not. I yet have to confirm this, but I can imagine that Windows users (or basically any end-user) cannot run this unittest due to path mismatches (and missing script file).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are already directories test_mod
and test_world
inside unittests
. They are used in some other unit test code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
See #11882
Let's start with basic unit tests.
To do
This PR is Ready for Review.
How to test
./minetest --run-unittests