diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
commit | ed5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch) | |
tree | 7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /writerfilter/qa/ooxml/watch-generated-code.sh | |
parent | Initial commit. (diff) | |
download | libreoffice-upstream.tar.xz libreoffice-upstream.zip |
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'writerfilter/qa/ooxml/watch-generated-code.sh')
-rwxr-xr-x | writerfilter/qa/ooxml/watch-generated-code.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/writerfilter/qa/ooxml/watch-generated-code.sh b/writerfilter/qa/ooxml/watch-generated-code.sh new file mode 100755 index 000000000..d7026be82 --- /dev/null +++ b/writerfilter/qa/ooxml/watch-generated-code.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +if [ ! -e bin/get_config_variables ]; then + cd ../../.. +fi + +. bin/get_config_variables SRCDIR + +if [ "$PWD" != "$SRCDIR" ]; then + echo "error: not in the expected SRCDIR" + exit 1 +fi + +cd writerfilter +echo 'include Makefile' > watch.mk +echo 'watch:' >> watch.mk +echo $'\techo $(writerfilter_ALL)' >> watch.mk +mydir=workdir/CustomTarget/writerfilter +writerfilter_ALL=$(make -sr -f watch.mk watch|sed "s|$SRCDIR/$mydir/||g") +rm watch.mk +cd - >/dev/null + +case $1 in +reference) + rm -rf $mydir-reference + mkdir -p $mydir-reference/source/ooxml + for i in $writerfilter_ALL + do + cp $mydir/"$i" $mydir-reference/"$i" + done + ;; +compare) + for i in $writerfilter_ALL + do + if [ "$(basename "$i")" == "model_preprocessed.xml" ]; then + continue + fi + diff -u $mydir-reference/"$i" $mydir/"$i" + done + ;; +*) + echo "usage: $0 [ reference | compare ]" + echo + echo "$0 first saves a reference output of all generated files by writerfilter, then" + echo "allows comparing against it. This helps seeing the effect of changes made on" + echo "the code generator scripts." + ;; +esac + +# vi:set shiftwidth=4 expandtab: |