aboutsummaryrefslogtreecommitdiffstats
path: root/test.awk
blob: a717ff7e386d6cde3c58e14071d8ec07dcd41033 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/awk -f

BEGIN {
  if (ARGC != 3) {
    printf("usage: test.awk <program> <test-vec-file>\n", ARGV[0]);
    exit 1
  }

  program = ARGV[1]
  file = ARGV[2]

  while ((getline < file) > 0) {
    input = ($1 == "EMPTY" ? "" : $1)
    program " '" input "'" | getline jhash
    print $1, "-->", jhash
  }
}