Debian Codegraph @

tests/codestyle/all.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 # Copyright 2014--2015 Red Hat Inc., Durham, North Carolina.
4 # All Rights Reserved.
5
6 set -e -o pipefail
7
8 . $builddir/tests/test_common.sh
9
10 function test_illicit_function_usescip-shell shell shell-project 0.0.0 test_illicit_function_use(). {
11 codebase=$(findscip-shell system . . find. $top_srcdir/src/ -regex '.*\.[ch]x*')
12 if grepscip-shell system . . grep. xmlReaderForFile $codebase; then
13 echoscip-shell system . . echo. "xmlReaderForFile is not allowed within OpenSCAP project. Please make a use of oscap_source facility."
14 return 1;
15 fi
16 if grepscip-shell system . . grep. xmlTextReaderSetErrorHandler $codebase; then
17 echoscip-shell system . . echo. "xmlTextReaderSetErrorHandler is not allowed within OpenSCAP project. Please make a use of oscap_source facility."
18 return 1;
19 fi
20 if grepscip-shell system . . grep. xmlTextReaderReadString $codebase; then
21 echoscip-shell system . . echo. "xmlTextReaderReadString is not allowed within OpenSCAP project. Its implementation in libxml does not play well with xmlWalkerReader."
22 return 1;
23 fi
24
25 codebase_without_xml_read_file=$(echoscip-shell system . . echo. $codebase | xsed 's/\S*\/source\/oscap_source.c / /g' -)
26 if grepscip-shell system . . grep. xmlReadFile $codebase_without_xml_read_file; then
27 echoscip-shell system . . echo. "xmlReadFile is not allowed within OpenSCAP project. Please make a use of oscap_source facility."
28 return 1;
29 fi
30 }
31
32 function shell_script_syntaxscip-shell shell shell-project 0.0.0 shell_script_syntax().(){
33 for script in $@; do
34 bashscip-shell system . . bash. -n -u $top_srcdir/$script
35 done
36 }
37
38 test_init "test_codebase.log"
39
40 if [scip-shell system . . `[`. -z ${CUSTOM_OSCAP+x} ] ; then
41 test_run "illicit use of functions" test_illicit_function_use 0
42 test_run "Check syntax of distributed shell scripts" shell_script_syntax \
43 utils/oscap-ssh
44 fi
45
46 test_exit