summaryrefslogtreecommitdiffstats
path: root/bin/dtf-gen
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dtf-gen')
-rwxr-xr-xbin/dtf-gen27
1 files changed, 23 insertions, 4 deletions
diff --git a/bin/dtf-gen b/bin/dtf-gen
index 67247a2..474dec7 100755
--- a/bin/dtf-gen
+++ b/bin/dtf-gen
@@ -7,7 +7,9 @@
## - each test might have several tags -- future dependencies
DTF_OUTPUT=DTF_OUTPUT
+DG=dg
+export opt_distro=fedora-rawhide-x86_64
# config
: ${outputdir=$PWD/$DTF_OUTPUT}
@@ -28,6 +30,12 @@ info ()
}
+dg_call ()
+{
+ "$DG" --distro="$opt_distro".yaml "$@"
+}
+
+
generate_wrapper ()
{
_run_cmd=$outputdir/$1/run
@@ -54,7 +62,7 @@ export top_srcdir=\$srcdir/$(printf %q "$2")
export testname=$(printf %q "$fix_testname")
EOF
- cat "$dtftpldir/run.tpl" >> "$_run_cmd"
+ dg_call --template "$dtftpldir/run.tpl" >> "$_run_cmd" || exit 1
chmod +x "$_run_cmd"
}
@@ -71,9 +79,14 @@ count_recursive_walk ()
mkdir -p "$outputdir/$2"
generate_wrapper "$2" "$3"
- test -f testcase \
- && cp testcase "$outputdir/$2"
- test -f library && cat library >> "$outputdir/library"
+
+ if test -f testcase; then
+ dg_call --template testcase --output "$outputdir/$2/testcase"
+ test $? -eq 0 || exit 1
+ fi
+
+ test -f library && dg_call --template library >> "$outputdir/library"
+ test $? -eq 0 || exit 1
for _rw_i in *
do
@@ -88,6 +101,12 @@ count_recursive_walk ()
}
+# TODO: option parsing
+if test x"$1" == x--distro
+then
+ test -n "$2" && opt_distro="$2"
+fi
+
test -d "$outputdir" && {
chmod u+w "$outputdir" -R
/bin/rm -rf "$outputdir"