6 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
Procyonae 37a45ad894 Jsonify road (#67223)
* Create road.json

* Zzz

* Split files up into a folder

* Failing to make diags match

* Tees and crossroads

* Traffic lights and crosswalks

* Change to linear naming

* Doesn't seem to break anything

* Another one bites the dust

* And another one down

* Finish renaming

* And another one bites the dust

* Fairly good state

* Idk

* 2nd try at bend decision making

* 3rd try

Almost there just one awkward edge case

* 4th try...

* Messing with other stuff instead

* Any adjacent sidewalk check (should defo add a way to do this without 8 nests)

* Adds some lineage to the diags but I'm going to scrap it and use the existing hack instead

* Gave in and implemented the existing hack

* Rebase for new function

* First part of vehicle placement nightmare

* Hopefully the vehicle placement for tee works

* Update road_aux.json

* Moves nests out of temp file

* Tweaks

* Straight vehicles

* Linted

* Crossroad vehicles

* Curved vehicles

* Zombie spawns

* Rotate _end the right way

* End vehicles

* Tweaks + Basic Layby (needs tee/4way nests)

* Clang/Test fixes

* Lint

* Apply suggestions from code review

* Jack-knifed semi correct placement

* Parked north alignment

* Rest of the initial vehicle placements

* Nests to aux file

* Removes double back logic, starts renaming a few things

* Changed a start location that was gaslighting me

* More reorganisation

* Even more reorg

* Lint

* Fixed ridiculous zed spawn rate

* Extra flags_any

* Graphical Overmaps

* Street lights

* Curve sidewalk variants

* No Hope

Please could someone sanity check this

* Really minor crosswalk tweak

* No Hope police pileup coord tweak

* No Hope police pileup coord tweak

* Update road_vehicles_nested.json

* Update road_vehicles_nested.json

* More mod stuff

* Update s_gas.json
2023-08-02 23:04:15 -05: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
Kevin Granade 6d1841ac67 Precompiled Catch2 header (#42453)
* Hoist catch.hpp include to the top of files

* Precompile the catch header in tests
2020-07-29 01:28:26 +03:00
John Bytheway e189957ff2 Run IWYU 20200408 (#39364)
* Helper script to run IWYU

* Run IWYU

* Update deprecated headers

* Run IWYU again

* Re-suppress cxxabi.h

This pragma got accidentally removed because it was deemed to be a
comment attached to a #include.

* Remove extra SDL header includes

* Fix ime.cpp headers

Some tweaks to help IWYU not break this file by messing with
platform-specific stuff not relevant on Linux.

* Update game.h

* Move new point.h includes inside #ifdef

* Re-add platform_win.h to mapsharing.cpp

* Apply suggestions from code review

Co-authored-by: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com>
2020-04-10 12:16:19 +03:00
Eric Pierce d017afbbb5 Overmap and mapgen: testing, cleanup, and documentation (#39107)
* Add unit tests for is_ot_match

Includes sections for exact, type, prefix, and contains match types.

* Link other docs and format x,y,z examples

* Add connects_to test case and comments

As the comment above connects_to has indicated for years, this function
is hideous. I must have stared at it for 10 minutes before I understood
what it was doing. Now it remains hideous, but with marginally better
documentation and a fairly comprehensive test case.

* Reformat MAPGEN.md

This is a first pass at reformatting, including:

- Using `preformatted` strings where appropriate
- JSON syntax for code blocks
- Formatting value/description lists as tables
- Wrapping most text to 120 columns
- Simplifying to make vim Markdown syntax highligher happier

* Add table and JSON formatting

* Reformat MAPGEN.md with tables, heading levels

* Format more tables and clean things up

* Format tables, relabel heading, remove quotes

* Format and tidy up tables

* Rewrite headings and eliminate remaining numbers

* Add table of contents

* Add table of top-level JSON fields with links

* Document field intensity

* Align table columns

* Remove JSON table

All these are already referenced in the main TOC; they are redundant
(and possibly misleading) being in this section, and need a more careful
explanation.
2020-04-03 01:17:29 +03:00