| 1 | #!/bin/bash -e |
| 2 | # -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- |
| 3 | |
| 4 | # This Source Code Form is subject to the terms of the Mozilla Public |
| 5 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 6 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 7 | |
| 8 | # usage: get-universe.sh logfile(s) > universe.data |
| 9 | # |
| 10 | # get-universe.sh reads the processed javascript logs and writes to |
| 11 | # stdout the unique set of fields to be used as the "universe" of test |
| 12 | # run data. These values are used by pattern-expander.pl and |
| 13 | # pattern-extracter.pl to encode the known failure files into regular |
| 14 | # expressions. |
| 15 | |
| 16 | export LC_ALL=C # handle all character sets |
| 17 | |
| 18 | (for f in $@; do |
| 19 | grep -h -m 1 TEST_ID $f | tr -dc '[\040-\177\n]' | sed 's|^TEST_ID=[^,]*, \(TEST_BRANCH=[^,]*, TEST_REPO=[^,]*, TEST_BUILDTYPE=[^,]*, TEST_TYPE=[^,]*\), \(TEST_OS=[^,]*, TEST_KERNEL=[^,]*, TEST_PROCESSORTYPE=[^,]*, TEST_MEMORY=[^,]*, TEST_TIMEZONE=[^,]*, TEST_OPTIONS=[^,]*\),.*|\2, \1|' |
| 20 | done) | sort -u |