]> granicus.if.org Git - libexpat/commitdiff
qa.sh: Merge callgraphs into one
authorSebastian Pipping <sebastian@pipping.org>
Mon, 30 May 2016 18:56:00 +0000 (20:56 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Mon, 30 May 2016 18:59:05 +0000 (20:59 +0200)
expat/.gitignore
expat/qa.sh

index 7db88355a03db13f39428eda6f2416c46b0943e9..a619cccd2fb76f2dc8a768c191f2c1d576005260 100755 (executable)
@@ -25,4 +25,4 @@ expat.pc
 *.gcov
 *.nccout
 *.expand
-/callgraph--*
+/callgraph.svg
index 464eac2d910dab70be92271093fc1f9c17fcd48c..e275021b995b165bf77cb29e416b61e16fd1bc88 100755 (executable)
@@ -17,14 +17,17 @@ set -o nounset
 
 : ${BASE_FLAGS:="-pipe -Wall -Wextra -pedantic -Wno-overlength-strings"}
 
-RUN() {
+ANNOUNCE() {
     local open='\e[1m'
     local close='\e[0m'
 
     echo -e -n "${open}"
     echo -n "# $*"
     echo -e "${close}"
+}
 
+RUN() {
+    ANNOUNCE "$@"
     env "$@"
 }
 
@@ -102,14 +105,14 @@ main() {
         ;;
     egypt)
         local DOT_FORMAT="${DOT_FORMAT:-svg}"
-        local i=, o=
-        while read i ; do
-            o="${i##./}";
-            o="callgraph--${o//\//--}"
-            o="${o%.c.*.expand}";
-            o="${o//./_}.${DOT_FORMAT}"
-            egypt "${i}" | dot -Grankdir=LR "-T${DOT_FORMAT}" > "${o}"
-        done < <(find -name '*.expand')
+        local o="callgraph.${DOT_FORMAT}"
+        ANNOUNCE "egypt ...... | dot ...... > ${o}"
+        find -name '*.expand' \
+                | sort \
+                | xargs -r egypt \
+                | unflatten -c 20 \
+                | dot -T${DOT_FORMAT} -Grankdir=LR \
+                > "${o}"
         ;;
     ncc)
         RUN nccnav ./.libs/libexpat.a.nccout