File: run-test.sh

package info (click to toggle)
tup 0.8-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,076 kB
  • sloc: ansic: 256,651; sh: 19,101; perl: 184; python: 67; lisp: 63; makefile: 56
file content (55 lines) | stat: -rwxr-xr-x 1,063 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/bash

TUP=$(pwd)/../../tup

rm -rf run_test_tmp
mkdir run_test_tmp
cd run_test_tmp
niter=3
../gen-test-case.pl "$@" || exit 1
sync

# Run the full gamut of tests for one of the tools:
benchmark ()
{
	tool="$1"
	initialize="$2"
	start="$3"
	update="$4"
	finish="$5"

	cd t$tool
	find . -type f | while read i; do cat $i > /dev/null; done
	eval "$initialize"
	echo "$tool: initial"
	eval "$start"
	time -p eval "$update"
	sync
	cfile=`find . -name 0.c`;
	hfile=`find . -name 0.h`;

	echo "$tool: 0.c touched"
	for i in `seq 1 $niter`; do
		sleep 1; touch $cfile
		time -p eval "$update"
	done

	echo "$tool: 0.h touched"
	for i in `seq 1 $niter`; do
		sleep 1; touch $hfile
		time -p eval "$update"
	done

	echo "$tool: nothing"
	for i in `seq 1 $niter`; do
		time -p eval "$update"
	done

	eval "$finish"
	cd ..
}

benchmark "make" ":" ":" "make -rR > /dev/null" ":"
benchmark "tup" "$TUP init --force > /dev/null" "$TUP monitor" "$TUP upd > /dev/null" "$TUP stop"

#diff -r tmake ttup | grep -v Makefile | grep -v build | grep -v '\.d$' | grep -v '\.tup'