diff --git a/.travis.yml b/.travis.yml index b6eb33966b7..edd9984f84c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,9 +36,14 @@ script: - (num=`grep -E '\\\\(red|blue|green|black|b|i[^mc])' **/*.dm | wc -l`; echo "$num escapes (expecting ${MACRO_COUNT} or less)"; [ $num -le ${MACRO_COUNT} ]) - source $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}/byond/bin/byondsetup - python tools/TagMatcher/tag-matcher.py ../.. - - echo "#define UNIT_TEST 1" > code/_unit_tests.dm + #First compile is to ensure maps are valid. + - echo "#define MAP_TEST 1" > code/_map_tests.dm - cp config/example/* config/ - DreamMaker polaris.dme + - echo "#define MAP_TEST 0" > code/_map_tests.dm + #Second compile is for the unit tests. Compiling a second time to exclude the validated maps is actually faster than waiting for startup with them compiled. + - echo "#define UNIT_TEST 1" > code/_unit_tests.dm + - DreamMaker polaris.dme - DreamDaemon polaris.dmb -invisible -trusted -core 2>&1 | tee log.txt - grep "All Unit Tests Passed" log.txt diff --git a/code/_map_tests.dm b/code/_map_tests.dm new file mode 100644 index 00000000000..90a4004b792 --- /dev/null +++ b/code/_map_tests.dm @@ -0,0 +1,10 @@ +/* + * + * This file is used by Travis to indicate that additional maps need to be compiled to look for errors such as missing paths. + * Do not add anything but the MAP_TEST definition here as it will be overwritten by Travis when running tests. + * + * + * Should you wish to edit set MAP_TEST to 1 like so: + * #define MAP_TEST 1 + */ +#define MAP_TEST 0 diff --git a/code/unit_tests/map_tests.dm b/code/unit_tests/map_tests.dm index eb0e41e117c..25f6f7557a9 100644 --- a/code/unit_tests/map_tests.dm +++ b/code/unit_tests/map_tests.dm @@ -13,8 +13,8 @@ /area/supply/station, /area/mine, /area/vacant/vacant_shop, - /area/turbolift - ) + /area/turbolift, + /area/submap ) var/list/exempt_from_atmos = typesof(/area/maintenance, /area/storage, diff --git a/maps/submaps/_readme.dm b/maps/submaps/_readme.dm index 1608dfe5b1c..0677d6d8d63 100644 --- a/maps/submaps/_readme.dm +++ b/maps/submaps/_readme.dm @@ -24,4 +24,8 @@ is being loaded (to clear trees, etc). Be sure to not load the map on top of an irreplacable objects or players, as they will all get deleted if annihilate is on. If you load the submap before other objects have a chance to spawn (before random map gen), you shouldn't need to use annihilate. + When adding a new submap which will be loaded at runtime, you should add it to the list of '#include'-s on the top of the +map template file. This forces the submap to be compiled when the code is undergoing a unit test, which will help keep the +submap from suffering errors such as invalid paths due to them being changed elsewhere. + */ \ No newline at end of file diff --git a/maps/submaps/cave_submaps/cave.dm b/maps/submaps/cave_submaps/cave.dm index f5fb874b4a0..87ab786d792 100644 --- a/maps/submaps/cave_submaps/cave.dm +++ b/maps/submaps/cave_submaps/cave.dm @@ -1,3 +1,12 @@ +// This causes PoI maps to get 'checked' and compiled, when undergoing a unit test. +// This is so Travis can validate PoIs, and ensure future changes don't break PoIs, as PoIs are loaded at runtime and the compiler can't catch errors. +// When adding a new PoI, please add it to this list. +#if MAP_TEST +#include "deadBeacon.dmm" +#include "prepper1.dmm" +#include "quarantineshuttle.dmm" +#endif + /datum/map_template/cave name = "Cave Content" desc = "Don't dig too deep!" diff --git a/maps/submaps/space_submaps/space.dm b/maps/submaps/space_submaps/space.dm index cfa45b6965d..a4771861e53 100644 --- a/maps/submaps/space_submaps/space.dm +++ b/maps/submaps/space_submaps/space.dm @@ -1,3 +1,10 @@ +// This causes PoI maps to get 'checked' and compiled, when undergoing a unit test. +// This is so Travis can validate PoIs, and ensure future changes don't break PoIs, as PoIs are loaded at runtime and the compiler can't catch errors. +// When adding a new PoI, please add it to this list. +#if MAP_TEST +// #define "your_map_here.dmm" +#endif + /datum/map_template/space name = "Space Content" desc = "A map template base. In space." diff --git a/maps/submaps/surface_submaps/forest.dm b/maps/submaps/surface_submaps/forest.dm index 40a045a37da..6cd100a497a 100644 --- a/maps/submaps/surface_submaps/forest.dm +++ b/maps/submaps/surface_submaps/forest.dm @@ -1,3 +1,11 @@ +// This causes PoI maps to get 'checked' and compiled, when undergoing a unit test. +// This is so Travis can validate PoIs, and ensure future changes don't break PoIs, as PoIs are loaded at runtime and the compiler can't catch errors. +// When adding a new PoI, please add it to this list. +#if MAP_TEST +#include "farm1.dmm" +#include "spider1.dmm" +#endif + /datum/map_template/surface name = "Surface Content" desc = "Used to make the surface by 17% less boring." diff --git a/polaris.dme b/polaris.dme index 0c4ebdf186b..e50395a1e44 100644 --- a/polaris.dme +++ b/polaris.dme @@ -11,6 +11,7 @@ // END_PREFERENCES // BEGIN_INCLUDE #include "code\_macros.dm" +#include "code\_map_tests.dm" #include "code\_unit_tests.dm" #include "code\global.dm" #include "code\hub.dm"