12 Commits

Author SHA1 Message Date
Matthew Richmond 9020833ece Stabilize test state resets and highway debug logging (#88577)
* Stabilize test state resets and highway debug logging

* tests: widen melee damage tolerance

* ci: retry overmap coverage

* ci: retry shader compile
2026-09-08 15:08:34 +02:00
dumb-kevin 1cad28fd43 Avoid unnecessary copies in drop and debug menu helpers
- bind item_location by const ref in zone drop debug log loop in activity_actor.cpp
- bind mission_type::get_all() result by const ref in mission-add debug menu
- bind selected dialogue topic by const ref in talk-topic debug menu
- NOLINT outfit_component copy near who.takeoff; takeoff can invalidate worn_item before force_insert_item runs
2026-05-09 10:02:28 +04:00
moxian 8b6cbac614 Stop including catch.hpp directly
.. as suggested by the comment in cata_catch.h:

// To avoid ODR violations, it's important that whenever a file includes
// catch.hpp it also includes stringmaker.h, so that all specializations of
// StringMaker match.  Therefore, all test code should include catch.hpp via
// this file.

Honestly, i'm not exactly sure how valuable this is, given that we've
been running with the current odr-violating(?) setup for a while nand
not had many issues, but sure, why not.
2025-02-16 19:45:21 -08:00
moxian 2ee44002fd Mechanically IWYU the tests
python3 ~/github/include-what-you-use/iwyu_tool.py -j5 -p build $( find
src/ tests/ -maxdepth 1 -name '*.cpp' | grep -v -f
tools/iwyu/bad_files.txt )  --  -Xiwyu --comment_style=long -Xiwyu -
-max_line_length=1000 -Xiwyu --cxx17ns -Xiwyu
--mapping_file=../tools/iwyu/cata.imp   | tee out/iwyu/f-a-01.txt >
/dev/null

followed by

cat out/iwyu/f-a-02.txt | python3
~/github/include-what-you-use/fix_includes.py --reorder --nosafe_headers

followed by manual fixups of <stddef.h> -> <cstddef> and similar.

tests/generic_factory_test.cpp gets mangled very badly (IWYU bug) so
it's excluded from the list.

Code size:
includes:
$ cat obj/tiles/*.inc | wc
 288068  576136 17898260
$ cat tests/obj/tiles/*.inc | wc
 167044  334088 10465766

post-processed source (clang -E):
./make_preproc.sh src/
68567896 177775140 2134075721
./make_preproc.sh tests/
39341957 102891720 1243323710
2025-02-10 00:46:57 -08:00
Zhilkin Serg 7f91d0c939 Allow free selection of cataclysm and game start dates in new character menu (#67772)
* Added UI element to select and return time point

+ utilized it in debug menu

* Reworked scenario calendar

- removed `random` calendar entries from scenarion definitions
- allowed free selection of cataclysm and game start dates in new character menu
- updated UI in new character menu
- fixed start date related tests
- updated docs
2023-08-19 23:13:36 -07:00
Zhilkin Serg e1a605f628 Fix scenario start dates (#67579)
* Clarify start date keybinding descriptions

* Fix default start date values

* Add start date reset keybindings

* Refine start date display UI in new character menu
2023-08-10 20:08:03 -05:00
akrieger 11a83c8103 Fix start date tests corrupting global state (#67574) 2023-08-10 22:53:01 +03:00
Zhilkin Serg 6965994772 Cataclysm and game start dates are to be set through scenarios (#67472)
* Cataclysm and game start dates are to be set through scenarios

* Make years and days in debug menu non-zero based
2023-08-08 14:42:01 -05:00
Alexey 07356b65a5 Normalize TEST_CASE names (#66241)
* Convert integer parsing test to use normal TEST_CASEs

* Rename test name too similar to another

* Test to enforce normalized test names

* Normalize TEST_CASE names (scripted)
2023-06-17 13:57:19 -03:00
sethsimon 54c6e79d29 Fix height and age strings in the new character window (#61055) 2022-10-15 20:41:10 +03:00
John Bytheway e95a4fc9b8 Promote string_id constants to global statics
Our string_id constants were a mixture of temporaries, locals, and
globals.  Pull them all out as globals, for consistency and efficiency.
The efficiency comes from the fact that each string_id instance caches
its respective int_id, and sharing one instance means that value need
not be recomputed.
2021-11-19 19:10:09 -05:00
Hirmuolio 4933100273 Refactor game start date (#47372)
* docs: update TOC
* refactor scenario date
* limit initial date to first year
* limit initial date to first year
* renamed custom_start_date
* doc for defaults
* better randomness
* random scenario date tests
* finishing touches on tests
* reduce chance for date collision
Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com>
Co-authored-by: TOC Generator <noreply@example.invalid>
2021-07-30 21:46:21 -07:00