12 Commits

Author SHA1 Message Date
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
Dillon Matchett dbd8cd966a Incremental skills (#65004)
* Down to construction.cpp

* finished crafting

* crafting gui

* Update faction.cpp

* Update faction_camp.cpp

* Update game.cpp

* down to handle action

* Update iexamine.cpp

* Update item.cpp

* Update iuse.cpp

* Update iuse_actor.cpp

* down to mattack

* Update melee.cpp

* Update mission_companion.cpp

* Update monattack.cpp

* up to npcmove

* Update npctalk.cpp

* Update npctrade.cpp

* Update ranged.cpp

* Update recipe.cpp

* Update trap.cpp

* Update trapfunc.cpp

* Update vehicle_use.cpp

* Update veh_type.cpp

* Update veh_utils.cpp

* tests

* was too big

* test fixes

* clang
2023-04-18 00:39:49 -04:00
actually-a-cat 6369a0a702 Fix adjust_for_focus (uncaps proficiency gain) 2022-09-12 18:49:18 +02: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
eltank e8f5707081 Revert focus_test to pre-#50262 state 2021-08-12 17:04:37 -07:00
Unknown f1c4129e36 Hobbies in Character Creation (#50262)
* Hobbies in Character Creation

Hobbies

Drug addictions are hobbies

Update newcharacter.cpp

cleanup + multiples of the same item

no items for hobbies. For now.

Update newcharacter.cpp

fix addictions

Hobbies give partial exp in chargen

convert hobby flag to subtype

fix build errors

fix focus tests

Squish

* Update savegame_json.cpp

* fix #50301

* Update data/json/hobbies.json

Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com>

* Update data/json/hobbies.json

Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com>

* refluff camping

* Update hobbies.json

Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com>
2021-07-30 08:49:30 -07:00
John Bytheway ebd549b300 Fix StringMaker ODR violations in tests
Catch2 provides a customization point for converting our types to
strings by specializing the StringMaker template.

We have some specializations in stringmaker.h, but this feature was only
working intermittently.  I finally figured out that was due to an ODR
violation.  The test files that didn't include stringmaker.h were
compiling a different specialization than the ones that did.

Re-jig the test includes so that any file including catch.hpp also
includes stringmaker.h, thereby ensuring that the custom
specializations are used everywhere and there is no ODR violation.

I achieved this by adding a new cata_catch.h header and making all
existing headers include catch.hpp via the new header.
2021-07-03 07:42:06 -07:00
anothersimulacrum 5d5509b8f4 Add test ensuring no UB on practicing combat skill 2021-03-13 15:55:53 -08:00
Kevin Granade 018a1b884c Make crafting practice occur every turn instead of occasionally. (#47186) 2021-03-09 14:52:53 +03:00
Binrui Dong 9fdb7ef59c Run IWYU
* Change _ctype.h and __locale to cctype and clocale

* Change _wctype.h to cwctype in game.cpp

* Change __functional_base to functional

* Remove libcxx internal headers

* Remove UNIX system headers

* Fix clang-tidy error with -nostdinc++
2021-02-06 00:18:41 -05:00
Kevin Granade 239ac1f09b Hide focus_pool behind setters and getters 2021-01-14 16:45:26 -08:00
Kevin Granade 93e997dcb6 Add tests around focus handling 2021-01-14 16:45:26 -08:00