File: 55-basic-pfc_binary_tree.sh

package info (click to toggle)
libseccomp 2.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,408 kB
  • sloc: ansic: 17,386; sh: 6,482; python: 1,656; makefile: 438
file content (46 lines) | stat: -rwxr-xr-x 796 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
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash

#
# libseccomp regression test automation data
#
# Copyright (c) 2019 Oracle and/or its affiliates.  All rights reserved.
# Author: Tom Hromatka <tom.hromatka@oracle.com>
#

####
# functions

#
# Dependency check
#
# Arguments:
#     1    Dependency to check for
#
function check_deps() {
	[[ -z "$1" ]] && return
	type -P "$1" >& /dev/null
	return $?
}

#
# Dependency verification
#
# Arguments:
#     1    Dependency to check for
#
function verify_deps() {
	[[ -z "$1" ]] && return
	if ! check_deps "$1"; then
		echo "error: install \"$1\" and include it in your \$PATH"
		exit 1
	fi
}

####
# functions

verify_deps diff

# compare output to the known good output, fail if different
./55-basic-pfc_binary_tree | \
	diff -q ${srcdir:=.}/55-basic-pfc_binary_tree.pfc - > /dev/null