root/trunk/test/test0058/test.sh

Revision 2212, 1.1 kB (checked in by dsugar, 5 years ago)

Build the fnet parser
moved the location of the built java to not conflict with the committed 'build'
directory.

  • Property svn:executable set to *
Line 
1 #!/bin/bash
2 DIR=`pwd`
3 cd ../..
4
5 RESULT=0
6
7 # LIBSELINUX needs to be passed in as the full path to libselinuxjava.so
8
9 #run the compiler test
10 java -cp javabuild com.tresys.framework.compiler.Compiler -fc test/basepolicy/file_contexts -pc test/basepolicy/ -ds framework-plugin/resources/dictionary/dictionary.fdic  -p $DIR/test.fpol -s $DIR/test.fsys -po $DIR/test.te -sf $DIR/test.fc -if $DIR/test.if -lib $LIBSELINUX > $DIR/test.out 2> $DIR/test.err
11
12 #check compiler error result
13 if [ $? -ne 1 ]; then
14         echo Unexpected error during compilation
15         RESULT=1
16 fi
17
18
19 #spaces removed so 'if' doesn't complain
20 EXPECTED_ERROR="Thedomain\"r\"isundefined"
21 if [ -e $DIR/test.err ]; then
22         LINES=`wc -l $DIR/test.err | cut -f 1 -d ' '`
23         if [ $LINES -ne 2 ]; then
24                 echo "Unexpected number of lines ($LINES should be 2) in test.err"
25                 RESULT=1
26         fi
27         ERROR=`cat -bs $DIR/test.err | grep 1 | cut -d : -f 4 | tr -d ' '`
28         if [ $ERROR != $EXPECTED_ERROR ]; then
29                 echo Unexpected error resulted
30                 RESULT=1
31         fi
32 else
33         echo Error output file does not exist
34         RESULT=1
35 fi
36
37 if [ $RESULT -eq 0 ]; then
38         echo Expected result
39 fi;
40
41 return $RESULT
Note: See TracBrowser for help on using the browser.