xref: /titanic_51/usr/src/lib/libsaveargs/tests/functional/test.sh (revision 702941cd97e30d600c2c1275823bc58231b2c361)
1*702941cdSRichard Lowe#! /usr/bin/ksh
2*702941cdSRichard Lowe#
3*702941cdSRichard Lowe# This file and its contents are supplied under the terms of the
4*702941cdSRichard Lowe# Common Development and Distribution License ("CDDL"), version 1.0.
5*702941cdSRichard Lowe# You may only use this file in accordance with the terms of version
6*702941cdSRichard Lowe# 1.0 of the CDDL.
7*702941cdSRichard Lowe#
8*702941cdSRichard Lowe# A full copy of the text of the CDDL should have accompanied this
9*702941cdSRichard Lowe# source.  A copy of the CDDL is also available via the Internet at
10*702941cdSRichard Lowe# http://www.illumos.org/license/CDDL.
11*702941cdSRichard Lowe#
12*702941cdSRichard Lowe
13*702941cdSRichard Lowe#
14*702941cdSRichard Lowe# Copyright 2012, Richard Lowe.
15*702941cdSRichard Lowe#
16*702941cdSRichard Lowe
17*702941cdSRichard Lowefunction tester {
18*702941cdSRichard Lowe    prog=${1}
19*702941cdSRichard Lowe    pattern=${2}
20*702941cdSRichard Lowe
21*702941cdSRichard Lowe    ./$prog >/dev/null &
22*702941cdSRichard Lowe    pid=$!
23*702941cdSRichard Lowe    if (/usr/bin/amd64/pstack $pid | /usr/xpg4/bin/grep -q "${pattern}"); then
24*702941cdSRichard Lowe        echo "pass: ${prog}"
25*702941cdSRichard Lowe    else
26*702941cdSRichard Lowe        echo "FAIL: ${prog}"
27*702941cdSRichard Lowe    fi
28*702941cdSRichard Lowe    kill $pid
29*702941cdSRichard Lowe}
30*702941cdSRichard Lowe
31*702941cdSRichard Lowetester align "test (1, 2, 3, 4, 5)"
32*702941cdSRichard Lowetester basic "test (1, 2, 3, 4)"
33*702941cdSRichard Lowetester big-struct-ret "test (1, 2, 3, 4)"
34*702941cdSRichard Lowetester big-struct-ret-and-spill "test (1, 2, 3, 4, 5, 6, 7, 8)"
35*702941cdSRichard Lowetester small-struct-ret "test (1, 2, 3, 4)"
36*702941cdSRichard Lowetester small-struct-ret-and-spill "test (1, 2, 3, 4, 5, 6, 7, 8)"
37*702941cdSRichard Lowetester stack-spill "test (1, 2, 3, 4, 5, 6, 7, 8)"
38