File: test.cmd

package info (click to toggle)
libgnatcoll 1.7gpl2015-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 17,280 kB
  • ctags: 1,124
  • sloc: ada: 134,072; python: 4,017; cpp: 1,397; ansic: 1,234; makefile: 368; sh: 152; xml: 31; sql: 6
file content (33 lines) | stat: -rwxr-xr-x 1,006 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

# utility function
check_duplications() {
   prefix="$1"
   entity_ref_request="select *,count(*) from entity_refs group by entity, file, line, column, kind, caller, from_instantiation having count(*) > 1;"
   f2f_request="select *,count(*) from f2f group by fromFile, toFile, kind  having count(*) >1 ;"
   e2e_request="select *,count(*) from e2e group by fromEntity, toEntity, kind, order_by  having count(*) >1 ;"

   echo "$prefix"
   echo "$entity_ref_request" | $SQLITE3_SHELL obj/gnatinspect.db
   echo "$e2e_request" | $SQLITE3_SHELL obj/gnatinspect.db
   echo "$f2f_request" | $SQLITE3_SHELL obj/gnatinspect.db
}


# cleanup
gprclean -q -Psimulation
rm -f obj/gnatinspect.db

# build and run gnatinspect the first time
gprbuild -f -q -p -Psimulation
gnatinspect --exit -Psimulation
check_duplications "First run"

# make sure timestamps get updated
sleep 2

# rebuild and relaunch gnatinspect
gprbuild -f -q -Psimulation
gnatinspect --exit -Psimulation

check_duplications "Second run"