summaryrefslogtreecommitdiff
path: root/.appveyor
diff options
context:
space:
mode:
authorFrank Benkstein <frank@benkstein.net>2018-10-22 15:41:12 -0700
committerWouter van Oortmerssen <aardappel@gmail.com>2018-10-22 15:41:12 -0700
commitefbb11e09354147c0716ba7a599723f2eb1526e2 (patch)
tree5f35b246b9c7d4b51ec1a5b3634a1990134c72ae /.appveyor
parent5c0f914f3859ae3920f7be6a618c17a47433bd85 (diff)
downloadflatbuffers-efbb11e09354147c0716ba7a599723f2eb1526e2.tar.gz
flatbuffers-efbb11e09354147c0716ba7a599723f2eb1526e2.tar.bz2
flatbuffers-efbb11e09354147c0716ba7a599723f2eb1526e2.zip
CI check generate code (#4998)
* call reflection code generation from tests This simplifies instructions to contributors so they don't forget to update reflection code. * add error handling to generate_code scripts Let them propagate their errors instead of swallowing them so they show up when called in CI. * apply editorconfig to shell scripts * use ordered map in dart codegen Using an unordered map in the codegen can lead to spurious diffs in the generated dart code. * add CI check for generate_code being run * update reflection_generated.h * disable diff-check for monster_test.bfbs Work around #5008.
Diffstat (limited to '.appveyor')
-rw-r--r--.appveyor/check-generate-code.bat40
1 files changed, 40 insertions, 0 deletions
diff --git a/.appveyor/check-generate-code.bat b/.appveyor/check-generate-code.bat
new file mode 100644
index 00000000..053c8b12
--- /dev/null
+++ b/.appveyor/check-generate-code.bat
@@ -0,0 +1,40 @@
+:: Copyright 2018 Google Inc. All rights reserved.
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+set buildtype=Release
+if "%1"=="-b" set buildtype=%2
+
+cd tests
+call generate_code.bat -b %buildtype% || goto FAIL
+
+:: TODO: Release and Debug builds produce differences here for some reason.
+git checkout HEAD -- monster_test.bfbs
+
+git -c core.autocrlf=true diff --exit-code --quiet || goto :DIFFFOUND
+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: ********************************************************" >&2
+@echo "" >&2
+@git -c core.autocrlf=true --no-pager diff --binary
+
+:FAIL
+set EXITCODE=1
+:SUCCESS
+cd ..
+EXIT /B %EXITCODE% \ No newline at end of file