mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 11:40:17 +01:00
The make-cairo-test-constructors.sh script executes several commands
without checking their success. This can lead to undetected errors,
like those fixed in 86fad78fcd.
The script now exits with an error status if no file is
input. Moreover, it sets the '-e' flag, so that if a command fails,
the whole script is immediately terminated with an error.
In the Makefile.am, the script result is now checked and the target
file is removed upon error. This ensures that the
'cairo-test-constructors.c' target completes succesfully only if no
error occurred.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
31 lines
490 B
Bash
31 lines
490 B
Bash
#! /bin/sh
|
|
|
|
set -e
|
|
|
|
if test $# -eq 0; then
|
|
echo "$0: no input files." >&2
|
|
exit 1
|
|
fi
|
|
|
|
cat <<HERE
|
|
/* WARNING: Autogenerated file - see $0! */
|
|
|
|
#include "cairo-test-private.h"
|
|
|
|
void _cairo_test_runner_register_tests (void);
|
|
|
|
HERE
|
|
|
|
cat "$@" | sed '/^CAIRO_TEST/!d; s/CAIRO_TEST.*(\(.*\),.*/extern void _register_\1 (void);/'
|
|
cat <<HERE
|
|
|
|
void
|
|
_cairo_test_runner_register_tests (void)
|
|
{
|
|
HERE
|
|
|
|
cat "$@" | sed '/^CAIRO_TEST/!d; s/CAIRO_TEST.*(\(.*\),.*/ _register_\1 ();/'
|
|
|
|
echo "}"
|
|
|
|
|