From e2b26ee19b3f680bbebf65c9c87ddff492cd25fd Mon Sep 17 00:00:00 2001 From: Derek Bailey Date: Fri, 24 Sep 2021 14:01:34 -0500 Subject: [PATCH] Make and generate_code.sh generate same outputs (#6855) * added --bfbs-builtins * update generate_code.bat * forgot the . * updated checking scripts * added bypass for the monster_test.bfbs and arrays_test.bfbs diff issue * removed check on windows for now --- .appveyor/check-generate-code.bat | 6 +- samples/monster.bfbs | Bin 1912 -> 1936 bytes scripts/check-generate-code.sh | 11 + tests/arrays_test.bfbs | Bin 1312 -> 1368 bytes tests/generate_code.bat | 6 +- tests/generate_code.sh | 6 +- tests/monster_test_bfbs_generated.h | 1296 ++++++++++++++------------- 7 files changed, 673 insertions(+), 652 deletions(-) diff --git a/.appveyor/check-generate-code.bat b/.appveyor/check-generate-code.bat index ba7398a2f..2a18cf992 100644 --- a/.appveyor/check-generate-code.bat +++ b/.appveyor/check-generate-code.bat @@ -27,9 +27,9 @@ goto SUCCESS :DIFFFOUND @echo "" >&2 @echo "ERROR: ********************************************************" >&2 -@echo "ERROR: The following differences were found after running the" >&2 -@echo "ERROR: tests/generate_code.sh script. Maybe you forgot to run" >&2 -@echo "ERROR: it after making changes in a generator or schema?" >&2 +@echo "ERROR: The following differences were found after building." >&2 +@echo "ERROR: Perhaps there is a difference in the flags for the" >&2 +@echo "ERROR: CMakeLists.txt vs the tests/generate_code.bat script?" >&2 @echo "ERROR: ********************************************************" >&2 @echo "" >&2 @git -c core.autocrlf=true --no-pager diff --binary diff --git a/samples/monster.bfbs b/samples/monster.bfbs index c49fa8cd971c7c7d94b24e0991656bf70931f003..003f22885242336956127b003f629168b5083879 100644 GIT binary patch delta 469 zcmZutJxc>Y6r8=gJrhhcqF}^R4i$-z4+s{5A|aq{5VbW#k_bW~Bq{6!?JOi=K~PK~ zSfw5#-1pTOlQCrlACjECqO`8=_R43->Nc+q4eEfHZjqahR>cPy4eHF7N z#kg9r?!>hkkeRUk(+LyQ;mWxZqX2Es^Hg2BVo_bmK~^l%+Q*FiFoDD9N1wL&Fc+^njm{rC$ZbWj2S delta 409 zcmYjN&ntvc6g}_z)i;LX|~gpiOt9;WnqP8JzuvZYgtLN zv7jWfu;34nf51kz3iCP7m~!j9bKZTod+vR;&X34+5JITX$J4mWyj8peDCQugc4_F*|vp9U1M!hyr%VXGEQPmxJWU z_vDlY^R6iwb4xADrP-gj`w9Y=`{|ATn^xt`ET}74u!dBdRID3yE)#Y(+W7t*Caj0s zD3(j|V0&_8d)qj*J diff --git a/scripts/check-generate-code.sh b/scripts/check-generate-code.sh index 1f2d84d4d..4cf274231 100755 --- a/scripts/check-generate-code.sh +++ b/scripts/check-generate-code.sh @@ -15,6 +15,17 @@ # limitations under the License. set -e +if ! git diff --quiet; then + echo >&2 + echo "ERROR: ********************************************************" >&2 + echo "ERROR: The following differences were found after building." >&2 + echo "ERROR: Perhaps there is a difference in the flags for the" >&2 + echo "ERROR: CMakeLists.txt vs the tests/generate_code.sh script?" >&2 + echo "ERROR: ********************************************************" >&2 + echo >&2 + git diff --binary --exit-code +fi + cd tests ./generate_code.sh cd .. diff --git a/tests/arrays_test.bfbs b/tests/arrays_test.bfbs index 5ab4edc0d90949f177a11d09611a5f03217cd3d4..762588b42ee5fb3173f2e942132db5da319b4439 100644 GIT binary patch delta 258 zcmZ3$b%V=Rfq{X+$;~MkNHK^oXfUuaa4_&N2msj<31*&xrBf#)aXG zjAoO6G8QwMOwMJJ7A*Pu|Gyw76IgE=P!-qYnM~@89g`0-NsH$E1IqC;F)#teL1w1_ zanj_EK=}ugC7Goe6(*Z9=j(!8VgSS-+Z3P}WTPMu>+2^L6(v>{$CsoQm*}M>6>mPs H9M1><77Z!J delta 224 zcmcb?wSdc1hJk^>$;~O4fkB8tg@J{EgMo)ZfI);oflzP9KguH zz%$WST}T7SVFuzAKmiFLHejAO&4}^c#*^WUjBb+^nTmB?{{8