From e10c98fe325de2534c2af661388f61dee397d826 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Sat, 27 Jan 2018 15:11:06 -0500 Subject: [PATCH 1/2] Make Travis run a build matrix, add new test --- .travis.yml | 23 ++++++++++++----------- code/_away_mission_tests.dm | 10 ++++++++++ 2 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 code/_away_mission_tests.dm diff --git a/.travis.yml b/.travis.yml index edd9984f84c..c58b11584f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,14 @@ language: c sudo: false env: - BYOND_MAJOR="511" - BYOND_MINOR="1381" - MACRO_COUNT=4 + global: + - BYOND_MAJOR="511" + - BYOND_MINOR="1381" + - MACRO_COUNT=4 + matrix: + - TEST_DEFINE="MAP_TEST" TEST_FILE="code/_map_tests.dm" RUN="0" + - TEST_DEFINE="AWAY_MISSION_TEST" TEST_FILE="code/_away_mission_tests.dm" RUN="0" + - TEST_DEFINE="UNIT_TEST" TEST_FILE="code/_unit_tests.dm" RUN="1" cache: directories: @@ -36,14 +41,10 @@ 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 ../.. - #First compile is to ensure maps are valid. - - echo "#define MAP_TEST 1" > code/_map_tests.dm + # Run our test - cp config/example/* config/ + - echo "#define ${TEST_DEFINE} 1" > ${TEST_FILE} - 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 + - if [ $RUN -eq 1 ]; then DreamDaemon polaris.dmb -invisible -trusted -core 2>&1 | tee log.txt; fi + - if [ $RUN -eq 1 ]; then grep "All Unit Tests Passed" log.txt; fi diff --git a/code/_away_mission_tests.dm b/code/_away_mission_tests.dm new file mode 100644 index 00000000000..75286fb34e4 --- /dev/null +++ b/code/_away_mission_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 AWAY_MISSION_TEST definition here as it will be overwritten by Travis when running tests. + * + * + * Should you wish to edit set AWAY_MISSION_TEST to 1 like so: + * #define AWAY_MISSION_TEST 1 + */ +#define AWAY_MISSION_TEST 0 From 8a6e092494cd93098eedcfb60b12d3c0ec536ad8 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Sat, 27 Jan 2018 15:37:00 -0500 Subject: [PATCH 2/2] Do not include main map during submap testing --- code/__defines/_compile_options.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/__defines/_compile_options.dm b/code/__defines/_compile_options.dm index e71ced7e29a..3190e391a46 100644 --- a/code/__defines/_compile_options.dm +++ b/code/__defines/_compile_options.dm @@ -5,4 +5,10 @@ 0 to allow using external resources or on-demand behaviour; 1 to use the default behaviour (preload compiled in recourses, not player uploaded ones); 2 for preloading absolutely everything; - */ \ No newline at end of file + */ + +// If we are doing the map test build, do not include the main maps, only the submaps. +#if MAP_TEST + #define USING_MAP_DATUM /datum/map + #define MAP_OVERRIDE 1 +#endif