• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
5set -e
6
7top_builddir=$PWD/..
8top_srcdir="$(cd $(dirname $0)/..; pwd)"
9
10cd $top_srcdir
11
12version=$(cat $top_srcdir/VERSION)
13if [ -d .git ]; then
14	version=$(git describe 2>/dev/null) || version=$(cat $top_srcdir/VERSION).GIT-UNKNOWN
15fi
16
17echo '{'
18echo ' "testsuite": {'
19echo '  "name": "Linux Test Project",'
20echo '  "short_name": "LTP",'
21echo '  "url": "https://github.com/linux-test-project/ltp/",'
22echo '  "scm_url_base": "https://github.com/linux-test-project/ltp/tree/master/",'
23echo "  \"version\": \"$version\""
24echo ' },'
25echo ' "defaults": {'
26echo '  "timeout": 300'
27echo ' },'
28echo ' "tests": {'
29
30first=1
31
32for test in `find testcases/ -name '*.c'`; do
33	a=$($top_builddir/metadata/metaparse -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
34	if [ -n "$a" ]; then
35		if [ -z "$first" ]; then
36			echo ','
37		fi
38		first=
39		cat <<EOF
40$a
41EOF
42	fi
43done
44
45echo
46echo ' }'
47echo '}'
48