Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add unit tests #16

Open
Flynsarmy opened this issue Feb 5, 2025 · 2 comments
Open

Add unit tests #16

Flynsarmy opened this issue Feb 5, 2025 · 2 comments

Comments

@Flynsarmy
Copy link
Contributor

This repo could really use a comprehensive suite of unit tests. Without them we're kinda flying blind.

@Flynsarmy
Copy link
Contributor Author

Flynsarmy commented Feb 5, 2025

I've been working on a unit testing PR but am having issues compiling. I'm not very good with C++ and have gotten stuck. Here's what I've got so far.

After pulling in the submodules, you can compile with scons target=template_debug --tests_enabled. The unit testing framework I went with is actually working wonderfully however when I try to test UtilityAI classes specifically, I get the following compilation error:

Compiling shared src\register_types.cpp ...
C:\path\to\Utility_AI\tests\test_bt_fixed_result.hpp(13): error C2065: 'UtilityAIBTFixedResult': undeclared identifier
C:\path\to\Utility_AI\tests\test_bt_fixed_result.hpp(13): error C7568: argument list missing after assumed function template 'Ref'
C:\path\to\Utility_AI\tests\test_bt_fixed_result.hpp(14): error C3861: 'print_verbose': identifier not found
scons: *** [src\register_types.windows.template_debug.x86_64.obj] Error 2
scons: building terminated because of errors.

Here's the exact line causing the issue https://github.com/Flynsarmy/Utility_AI/blob/b85508939e5d066ee6def349f4851acb0402554b/tests/test_bt_fixed_result.hpp#L13

You can see the unit testing framework in action by commenting out lines 13-14, compiling and running

godot.exe --headless --quit --path "C:\path\to\Utility_AI\demo"

Image

If you've got a spare moment I'd really appreciate some help getting a single test up and running after which I can start working on more.

@JarkkoPar
Copy link
Owner

Thanks for raising this and for your great work with all the other contributions! I have quite a lot going on just now with work but I will try and arrange some time for this next week.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants