update standards version
[debian/freetts] / tests / compareNumericUtt
1 #!/bin/sh
2 # Copyright 2001 Sun Microsystems, Inc.
3 # All Rights Reserved.  Use is subject to license terms.
4
5 # See the file "license.terms" for information on usage and
6 # redistribution of this file, and for a DISCLAIMER OF ALL 
7 # WARRANTIES.
8 #
9 # # This test script first runs the FreeTTS with our first utterance file,
10 # dumps the wave in text form, and compares (diff) it with our standard 
11 # wave form file for our first utterance (first.wave.txt). This test will
12 # tell you how many lines differ from the standard wave form file.
13 #
14 # (Reminder: our 'first utterance file' is "Hello world.  This is Duke 
15 # coming to you from inside the java virtual machine. I'm happy to have
16 # a voice because I've been meaning to tell you how much I care.")
17 #
18
19
20 # REF=../../../../../data/alice2.flite.v1.0-beta.rel
21 REF=utterance.ref.res
22 NEW=utterance.res
23
24 grep $1 $REF | grep -v Relation > t.$1.1
25 grep $1 $NEW | grep -v Relation > t.$1.2
26 pr -mt t.$1.1 t.$1.2 | sed 's/=/ /g' | awk ' {   
27     name = $1;
28     diff = ($2-$4);
29     if (diff < 0) {
30         diff = -diff;
31     }
32     if (diff > 1e-05) {
33         # print $2, $4, diff
34         count++;
35     }
36     tot++;
37 }
38
39 END {
40    if (count == 0) {
41        status = "Test Passed.";
42     } else {
43        status = "Test FAILED.";
44     }
45    label = name " " count " differences of " tot; 
46     printf("%40.40s. %s\n", label, status); 
47 }
48
49
50