summaryrefslogtreecommitdiff
path: root/libmisc/tests/test_obj_autobox.c.gen
blob: 3cfa3d4cbfc2c2cd3851a62bd47168ec0fefbf42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# libmisc/tests/test_obj_autobox.c.gen - Generate tests for LO_BOX()
#
# Copyright (C) 2025  Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later

infile=$1
outfile=$2

grep --quiet lo_box_ -- "$infile"

{
	echo "/* ${outfile} - Generated by \`$*\`.  DO NOT EDIT!  */"
	sed -E 's/lo_box_([a-z0-9_]+)_as_([a-z0-9_]+)\(/LO_BOX(\2, /g' <"$infile"
} >"$outfile"

! grep -H lo_box_ -- "$outfile"