head	1.2;
access;
symbols
	netbsd-11-0-RC6:1.2
	netbsd-11-0-RC5:1.2
	netbsd-11-0-RC4:1.2
	netbsd-11-0-RC3:1.2
	netbsd-11-0-RC2:1.2
	netbsd-11-0-RC1:1.2
	perseant-exfatfs-base-20250801:1.2
	netbsd-11:1.2.0.12
	netbsd-11-base:1.2
	netbsd-10-1-RELEASE:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.10
	perseant-exfatfs-base:1.2
	netbsd-10-0-RELEASE:1.2
	netbsd-10-0-RC6:1.2
	netbsd-10-0-RC5:1.2
	netbsd-10-0-RC4:1.2
	netbsd-10-0-RC3:1.2
	netbsd-10-0-RC2:1.2
	netbsd-10-0-RC1:1.2
	netbsd-10:1.2.0.8
	netbsd-10-base:1.2
	cjep_sun2x-base1:1.2
	cjep_sun2x:1.2.0.6
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	cjep_staticlib_x:1.2.0.4
	cjep_staticlib_x-base:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	phil-wifi:1.2.0.2
	is-mlppp:1.1.0.2
	is-mlppp-base:1.1
	phil-wifi-20200406:1.2;
locks; strict;
comment	@# @;


1.2
date	2020.03.25.13.07.04;	author isaki;	state Exp;
branches
	1.2.2.1;
next	1.1;
commitid	h8ukZehRwrpaEM1C;

1.1
date	2020.02.11.07.03.16;	author isaki;	state Exp;
branches;
next	;
commitid	wjiuxg2gNyPX0eWB;

1.2.2.1
date	2020.03.25.13.07.04;	author martin;	state dead;
branches;
next	1.2.2.2;
commitid	Qli2aW9E74UFuA3C;

1.2.2.2
date	2020.04.08.14.09.05;	author martin;	state Exp;
branches;
next	;
commitid	Qli2aW9E74UFuA3C;


desc
@@


1.2
log
@Use exact match to search testname.
This didn't affect test results.
@
text
@#	$NetBSD: t_audio.awk,v 1.1 2020/02/11 07:03:16 isaki Exp $
#
# Copyright (C) 2019 Tetsuya Isaki. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

BEGIN {
	n = 0
	print "#"
	print "# This file is regenerated by t_audio.awk"
	print "#"
	print ""
	print "# Call real test program, and then dispatch the result for atf."
	print "h_audio() {"
	print "	local testname=$1"
	print "	local outfile=/tmp/t_audio_$testname.$$"
	print "	$(atf_get_srcdir)/audiotest -ARe $testname > $outfile"
	print "	local retval=$?"
	print "	# Discard rump outputs..."
	print "	outmsg=`cat $outfile | grep -v '^\\['`"
	print "	rm -f $outfile"
	print "	if [ \"$retval\" = \"0\" ]; then"
	print "		atf_pass"
	print "	elif [ \"$retval\" = \"1\" ]; then"
	print "		atf_fail \"$outmsg\""
	print "	elif [ \"$retval\" = \"2\" ]; then"
	print "		atf_skip \"$outmsg\""
	print "	else"
	print "		atf_fail \"unknown error $retval\""
	print "	fi"
	print "}"
	print ""
}
# Gather only tab-indented ENT().  I.e.,
# ^\tENT(testname)     ... Enable in audiotest and add it to atf
# ^//\tENT(testname)   ... Disable in audiotest and also don't add to atf
# ^/**/\tENT(testname) ... Enable in audiotest but don't add to atf
match($0, /^\tENT\([^\)]*\)/) {
	name = substr($0, RSTART + 5, RLENGTH - 6)
	tests[n] = name
	n++;

	print "atf_test_case " name
	print name "_head() { }"
	print name "_body() {"
	print "\th_audio " name
	print "}"
	print ""
}
END {
	print "atf_init_test_cases() {"
	for (i = 0; i < length(tests); i++) {
		print "\tatf_add_test_case " tests[i]
	}
	print "}"
}
@


1.2.2.1
log
@file t_audio.awk was added on branch phil-wifi on 2020-04-08 14:09:05 +0000
@
text
@d1 76
@


1.2.2.2
log
@Merge changes from current as of 20200406
@
text
@a0 76
#	$NetBSD$
#
# Copyright (C) 2019 Tetsuya Isaki. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

BEGIN {
	n = 0
	print "#"
	print "# This file is regenerated by t_audio.awk"
	print "#"
	print ""
	print "# Call real test program, and then dispatch the result for atf."
	print "h_audio() {"
	print "	local testname=$1"
	print "	local outfile=/tmp/t_audio_$testname.$$"
	print "	$(atf_get_srcdir)/audiotest -ARe $testname > $outfile"
	print "	local retval=$?"
	print "	# Discard rump outputs..."
	print "	outmsg=`cat $outfile | grep -v '^\\['`"
	print "	rm -f $outfile"
	print "	if [ \"$retval\" = \"0\" ]; then"
	print "		atf_pass"
	print "	elif [ \"$retval\" = \"1\" ]; then"
	print "		atf_fail \"$outmsg\""
	print "	elif [ \"$retval\" = \"2\" ]; then"
	print "		atf_skip \"$outmsg\""
	print "	else"
	print "		atf_fail \"unknown error $retval\""
	print "	fi"
	print "}"
	print ""
}
# Gather only tab-indented ENT().  I.e.,
# ^\tENT(testname)     ... Enable in audiotest and add it to atf
# ^//\tENT(testname)   ... Disable in audiotest and also don't add to atf
# ^/**/\tENT(testname) ... Enable in audiotest but don't add to atf
match($0, /^\tENT\([^\)]*\)/) {
	name = substr($0, RSTART + 5, RLENGTH - 6)
	tests[n] = name
	n++;

	print "atf_test_case " name
	print name "_head() { }"
	print name "_body() {"
	print "\th_audio " name
	print "}"
	print ""
}
END {
	print "atf_init_test_cases() {"
	for (i = 0; i < length(tests); i++) {
		print "\tatf_add_test_case " tests[i]
	}
	print "}"
}
@


1.1
log
@Add ATF tests for audio(4).

    91 passed test cases
    0 failed test cases.
    0 expected failed test cases.
    62 skipped test cases.

There are many skipped tests, because the test itself supports full-
duplex, half-duplex and uni-directional devices but pad(4) used in ATF
tests is uni-directional device.
@
text
@d1 1
a1 1
#	$NetBSD$
d37 1
a37 1
	print "	$(atf_get_srcdir)/audiotest -AR $testname > $outfile"
@

