mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-07 13:53:38 +00:00
Added --filename-suffix and --filename-ext to flatc (#5778)
* Fixed refractoring issue in reflection/generate_code.sh. Also, mv deletes the original file, so I don't need to clean it up manually in that case. * Added --filename-suffix and --filename-ext to flatc * Fixed typo and added example generation of suffix and extension for C++ * Removed extra ; * Removed clang-format block from a region that didn't need it. Fixed an auto format of another clang-format block * Added docs, fixed pointer alignment, removed suffix test file
This commit is contained in:
@@ -49,6 +49,18 @@ $TEST_NOINCL_FLAGS $TEST_CPP_FLAGS $TEST_CS_FLAGS -o namespace_test namespace_te
|
||||
../flatc --python $TEST_BASE_FLAGS arrays_test.fbs
|
||||
../flatc --dart monster_extra.fbs
|
||||
|
||||
# Tests if the --filename-suffix and --filename-ext works and produces the same
|
||||
# outputs.
|
||||
../flatc --cpp --filename-suffix _suffix --filename-ext hpp $TEST_NOINCL_FLAGS $TEST_CPP_FLAGS -I include_test monster_test.fbs
|
||||
if [ -f "monster_test_suffix.hpp" ]; then
|
||||
if ! cmp -s "monster_test_suffix.hpp" "monster_test_generated.h"; then
|
||||
echo "[Error] Filename suffix option did not produce identical results"
|
||||
fi
|
||||
rm "monster_test_suffix.hpp"
|
||||
else
|
||||
echo "[Error] Filename suffix option did not produce a file"
|
||||
fi
|
||||
|
||||
# Flag c++17 requires Clang6, GCC7, MSVC2017 (_MSC_VER >= 1914) or higher.
|
||||
TEST_CPP17_FLAGS="--cpp --cpp-std c++17 -o ./cpp17/generated_cpp17 $TEST_NOINCL_FLAGS"
|
||||
../flatc $TEST_CPP17_FLAGS -I include_test monster_test.fbs
|
||||
|
||||
Reference in New Issue
Block a user