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