Cyril Hrubis | a069cd3 | 2020-10-05 15:30:46 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | # Copyright (c) 2019 Cyril Hrubis <chrubis@suse.cz> |
| 4 | # Copyright (c) 2020 Petr Vorel <pvorel@suse.cz> |
| 5 | set -e |
| 6 | |
| 7 | top_builddir=$PWD/.. |
Petr Vorel | 327cff7 | 2020-12-17 13:08:47 +0100 | [diff] [blame] | 8 | top_srcdir="$(cd $(dirname $0)/..; pwd)" |
Cyril Hrubis | a069cd3 | 2020-10-05 15:30:46 +0200 | [diff] [blame] | 9 | |
| 10 | cd $top_srcdir |
| 11 | |
| 12 | version=$(cat $top_srcdir/VERSION) |
| 13 | if [ -d .git ]; then |
| 14 | version=$(git describe 2>/dev/null) || version=$(cat $top_srcdir/VERSION).GIT-UNKNOWN |
| 15 | fi |
| 16 | |
| 17 | echo '{' |
| 18 | echo ' "testsuite": "Linux Test Project",' |
| 19 | echo ' "testsuite_short": "LTP",' |
| 20 | echo ' "url": "https://github.com/linux-test-project/ltp/",' |
| 21 | echo ' "scm_url_base": "https://github.com/linux-test-project/ltp/tree/master/",' |
| 22 | echo ' "timeout": 300,' |
| 23 | echo " \"version\": \"$version\"," |
| 24 | echo ' "tests": {' |
| 25 | |
| 26 | first=1 |
| 27 | |
| 28 | for test in `find testcases/ -name '*.c'`; do |
| 29 | a=$($top_builddir/docparse/docparse "$test") |
| 30 | if [ -n "$a" ]; then |
| 31 | if [ -z "$first" ]; then |
| 32 | echo ',' |
| 33 | fi |
| 34 | first= |
Petr Vorel | a7e7a90 | 2020-12-17 12:53:33 +0100 | [diff] [blame] | 35 | cat <<EOF |
| 36 | $a |
| 37 | EOF |
Cyril Hrubis | a069cd3 | 2020-10-05 15:30:46 +0200 | [diff] [blame] | 38 | fi |
| 39 | done |
| 40 | |
| 41 | echo |
| 42 | echo ' }' |
| 43 | echo '}' |