File: make.python

package info (click to toggle)
swig 1.1.p883-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 9,264 kB
  • ctags: 5,129
  • sloc: cpp: 20,856; ansic: 13,627; yacc: 3,314; python: 2,794; makefile: 2,216; perl: 1,970; tcl: 1,583; sh: 716; lisp: 201; objc: 143
file content (83 lines) | stat: -rwxr-xr-x 2,674 bytes parent folder | download | duplicates (4)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh

necho() {
   if [ "`echo -n`" = "-n" ]; then
      echo "${@}\c"
   else
      echo -n "${@}"
   fi
}

echo "Testing the SWIG C/C++ parser..."

# Make some of the larger files
perl makelarge.pl >large_comment.i
perl makeheader.pl >large_header.i

IFILE='
addmethods array code conditional constant cpp_const cpp_data cpp_func
cpp_inherit cpp_misc defarg doc enum_cond except extern function graph inline
library macro modlist multiline multinherit native nested new objc opengl ref
reference rename struct template test0.1a typedef typemap unsigned value
variable vector_ex void zero
large_comment
large_header'

LOGFILE='../../test.log'

rm -f ${LOGFILE}

echo "\nPerforming parser/regression tests on Python module..."
for i in ${IFILE}; do 
necho "    Testing (Python) : ${i}.i"; 
if ../../swig -I../../swig_lib -python -dnone -c++ -objc ${i}.i >${i}.python.output 2>&1; then 
# Look for a regression testing file
    if test -f ${i}_regr.python.c; then
         if diff ${i}_regr.python.c ${i}_wrap.c > ${i}.python.diff; then
             echo " ....... passed"
             rm -f ${i}.python.diff
         else
              echo " ....... FAILED COMPARE (see ${i}.python.diff) ***";
              echo "${i}.i (Python) ....... FAILED COMPARE (see ${i}.python.diff) ***" >> ${LOGFILE}
         fi;
    else
# Regression testing file doesn't exist, create it
         echo " ....... passed (creating ${i}_regr.python.c)"
         mv ${i}_wrap.c ${i}_regr.python.c
    fi;
rm -f ${i}_wrap*
else 
    echo " ....... FAILED (INTERNAL ERROR) ***";
    echo "${i}.i (Python) ....... FAILED (INTERNAL ERROR) ***" >> ${LOGFILE}
fi;
done


echo "\nPerforming parser/regression tests on Python shadow classes..."
for i in ${IFILE}; do 
necho "    Testing (Python shadow) : ${i}.i"; 
if ../../swig -I../../swig_lib -python -shadow -dnone -c++ -objc ${i}.i >${i}.pythons.output 2>&1; then 
# Look for a regression testing file
    if test -f ${i}_regr.pythons.c; then
         if diff ${i}_regr.pythons.c ${i}_wrap.c > ${i}.pythons.diff; then
             echo " ....... passed"
             rm -f ${i}.pythons.diff
         else
              echo " ....... FAILED COMPARE (see ${i}.pythons.diff) ***";
              echo "${i}.i (Python shadow) ....... FAILED COMPARE (see ${i}.pythons.diff) ***" >> ${LOGFILE}
         fi;
    else
# Regression testing file doesn't exist, create it
         echo " ....... passed (creating ${i}_regr.pythons.c)"
         mv ${i}_wrap.c ${i}_regr.pythons.c
    fi;

rm -f ${i}_wrap*
else 
    echo " ....... FAILED (INTERNAL ERROR) ***";
    echo "${i}.i (Python shadow) ....... FAILED (INTERNAL ERROR) ***" >> ${LOGFILE}
fi;
done