]>
iEval git - linux-seccomp.git/blob - libseccomp/tests/testdiff
4 # libseccomp test diff generator
6 # Copyright (c) 2013 Red Hat <pmoore@redhat.com>
7 # Author: Paul Moore <paul@paul-moore.com>
11 # This library is free software; you can redistribute it and/or modify it
12 # under the terms of version 2.1 of the GNU Lesser General Public License as
13 # published by the Free Software Foundation.
15 # This library is distributed in the hope that it will be useful, but WITHOUT
16 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
20 # You should have received a copy of the GNU Lesser General Public License
21 # along with this library; if not, see <http://www.gnu.org/licenses>.
28 # Print out script usage details
32 usage: regression [-h] LABEL_1 LABEL_2
34 libseccomp test diff generator script
36 -h show this help message and exit
41 # Print the test header
44 # 1 string containing generated test number
46 function print_test
() {
47 printf "Test %s comparison:\n" "$1"
54 # 1 string containing first test label
55 # 2 string containing second test label
57 function diff_tests
() {
76 for file in *-sim-*.tests
; do
77 # extract the batch name from the file name
78 batch_name
=$
(basename $file .tests
)
80 print_test
"$batch_name"
82 file_a
="${batch_name}${label_a}"
83 file_b
="${batch_name}${label_b}"
85 if [[ -r "$file_a.pfc" && -r "$file_b.pfc" ]]; then
86 diff -pu "$file_a.pfc" "$file_b.pfc"
89 if [[ -r "$file_a.bpf" && -r "$file_b.bpf" ]]; then
90 diff -pu "$file_a.bpf" "$file_b.bpf"
93 if [[ -r "$file_a.bpfd" && -r "$file_b.bpfd" ]]; then
94 diff -pu "$file_a.bpfd" "$file_b.bpfd"
107 while getopts "h" opt
; do
119 # display the test output and run the requested tests
120 echo "=============== $(date) ==============="
121 echo "Comparing Test Output (\"testdiff $*\")"
123 echo "============================================================"
This page took 0.054532 seconds and 5 git commands to generate.