xref: /freebsd/contrib/libucl/tests/speed.test (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1#!/bin/sh
2
3PROG=${TEST_BINARY_DIR}/test_speed
4
5sh -c "xz -c < /dev/null > /dev/null"
6echo 'Running speed tests'
7for _tin in ${TEST_DIR}/*.xz ; do
8	echo "Unpacking $_tin..."
9	xz -cd < $_tin > ${TEST_OUT_DIR}/test_file
10	# Preread file to cheat benchmark!
11	cat ${TEST_OUT_DIR}/test_file > /dev/null
12	echo "Starting benchmarking for $_tin..."
13	$PROG ${TEST_OUT_DIR}/test_file
14	if [ $? -ne 0 ] ; then
15		echo "Test: $_tin failed"
16		rm ${TEST_OUT_DIR}/test_file
17		exit 1
18	fi
19	rm ${TEST_OUT_DIR}/test_file
20done
21
22