Debian Codegraph @

contrib/utilities/query_testsuite

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 ## ------------------------------------------------------------------------
3 ##
4 ## SPDX-License-Identifier: LGPL-2.1-or-later
5 ## Copyright (C) 2018 - 2022 by the deal.II authors
6 ##
7 ## This file is part of the deal.II library.
8 ##
9 ## Part of the source code is dual licensed under Apache-2.0 WITH
10 ## LLVM-exception OR LGPL-2.1-or-later. Detailed license information
11 ## governing the source code and code contributions can be found in
12 ## LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
13 ##
14 ## ------------------------------------------------------------------------
15 set -eu
16
17 BASE_URL="https://cdash.dealii.org"
18
19 # Script to query CDash on the command line and create a formatted table
20
21 links=false
22 regex=".*"
23
24 print_helpscip-shell shell deal.ii 9.7.1-6 print_help().() {
25 echoscip-shell system . . echo. "Usage: query_testsuite [-c|--commit <commit>] [-l|--links] [-h|--help]"
26 echoscip-shell system . . echo. ""
27 echoscip-shell system . . echo. "Queries the CDash on the command line and creates a formatted table"
28 echoscip-shell system . . echo. "compatible with markdown"
29 echoscip-shell system . . echo. ""
30 echoscip-shell system . . echo. "Options:"
31 echoscip-shell system . . echo. " -r (--regex) : only show results for hosts/commits matching the specified regex"
32 echoscip-shell system . . echo. " -l (--links) : include hyperlinks"
33 echoscip-shell system . . echo. " -h (--help) : print this help message"
34 }
35
36 until [[ "$*" == "" ]]; do
37 if [[ "$1" == -h || "$1" == --help ]]; then
38 print_helpscip-shell shell deal.ii 9.7.1-6 print_help().
39 exit 1
40 elif [[ "$1" == -l || "$1" == --links ]]; then
41 links=true
42 elif [[ "$1" == -r || "$1" == --regex ]]; then
43 shift
44 regex="$1"
45 else
46 print_helpscip-shell shell deal.ii 9.7.1-6 print_help().
47 exit 1
48 fi
49 shift
50 done
51
52 if [scip-shell system . . `[`. -z "$(command -v jq)" ]; then
53 echoscip-shell system . . echo. "Error: need jq executable in path"
54 echoscip-shell system . . echo. "Please install jq (sudo apt install jq, sudo yum install jq)"
55 exit 1
56 fi
57
58 query_testsuitescip-shell shell deal.ii 9.7.1-6 query_testsuite().() {
59
60 echoscip-shell system . . echo. "| Host | Configuration | Commit | Build errors | Build warnings | Failing tests | Passing tests |"
61 echoscip-shell system . . echo. "| - | - | - | :-: | :-: | :-: | :-: |"
62
63 curlscip-shell system . . curl. -s "${BASE_URL}/api/v1/index.php?project=deal.II" |
64 jqscip-shell system . . jq. -r ".buildgroups | .[] | .builds | .[] | .id , .site , .buildname, .update.files, .compilation.error, .compilation.warning, .test.fail, .test.pass" |
65 pastescip-shell system . . paste. -d ' ' - - - - - - - - |
66 sortscip-shell system . . sort. -n |
67 if $links; then
68 awkscip-shell system . . awk. "{ print \$2,
69 \"[\" \$3 \"](${BASE_URL}/buildSummary.php?buildid=\" \$1 \")\", \
70 \"[\" \$4 \"](${BASE_URL}/viewUpdate.php?buildid=\" \$1 \")\", \
71 \"[\" \$5 \"](${BASE_URL}/viewBuildError.php?buildid=\" \$1 \")\", \
72 \"[\" \$6 \"](${BASE_URL}/viewBuildError.php?type=1&buildid=\" \$1 \")\", \
73 \"[\" \$7 \"](${BASE_URL}/viewTest.php?onlyfailed&buildid=\" \$1 \")\", \
74 \"[\" \$8 \"](${BASE_URL}/viewTest.php?onlypassed&buildid=\" \$1 \")\"
75 }"
76 else
77 awkscip-shell system . . awk. '{$1=""; print $0}'
78 fi |
79 sedscip-shell system . . sed. -e 's#^ ##' -e 's# # | #g' -e 's#^#| #' -e 's#$# |#' |
80 grepscip-shell system . . grep. -P "${regex}" |
81 catscip-shell system . . cat.
82 }
83
84 query_testsuitescip-shell shell deal.ii 9.7.1-6 query_testsuite().