From 352a37ac36924d850037a554ac4f02e5dc68fd8d Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Thu, 29 Jun 2023 10:10:35 +0200 Subject: [PATCH] re-import sources as agreed with the maintainer --- .gitignore | 25 ++++++++++++++++++++++++- test/help-usage/Makefile | 14 ++++++++++++++ test/help-usage/README.rst | 13 +++++++++++++ test/help-usage/runtask.yml | 29 +++++++++++++++++++++++++++++ test/help-usage/runtest.sh | 13 +++++++++++++ 5 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 test/help-usage/Makefile create mode 100644 test/help-usage/README.rst create mode 100644 test/help-usage/runtask.yml create mode 100755 test/help-usage/runtest.sh diff --git a/.gitignore b/.gitignore index b0f30fa..c9f8a2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,25 @@ -/sscg-2.3.3-stripped.tar.xz +/sscg-0.4.1.tar.gz +/sscg-1.0.0-a3fe426.tar.gz +/sscg-1.0.1-6858b79.tar.gz +/sscg-1.0.2-897a89a.tar.gz +/sscg-1.0.3-ecdee74.tar.gz +/sscg-1.0.4-024d20e.tar.gz +/sscg-1.1.0-4f90b27.tar.gz +/sscg-2.0.0.tar.gz +/sscg-2.0.1.tar.gz +/sscg-2.0.2.tar.gz +/sscg-2.0.3.tar.gz +/sscg-2.0.4.tar.gz +/sscg-2.1.0.tar.gz +/sscg-2.2.0.tar.gz +/sscg-2.3.0.tar.xz +/sscg-2.3.1.tar.xz +/sscg-2.3.2.tar.xz +/sscg-2.3.3.tar.xz +/sscg-2.4.0.tar.xz +/sscg-2.5.0.tar.xz +/sscg-2.5.1.tar.xz +/sscg-2.6.0.tar.xz +/sscg-2.6.1.tar.xz +/sscg-2.6.2.tar.xz /sscg-3.0.0.tar.xz diff --git a/test/help-usage/Makefile b/test/help-usage/Makefile new file mode 100644 index 0000000..d71e61f --- /dev/null +++ b/test/help-usage/Makefile @@ -0,0 +1,14 @@ +.PHONY: all install download clean + +BUILT_FILES= + +FILES=runtest.sh Makefile + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) diff --git a/test/help-usage/README.rst b/test/help-usage/README.rst new file mode 100644 index 0000000..e422484 --- /dev/null +++ b/test/help-usage/README.rst @@ -0,0 +1,13 @@ +help-usage +========== + +This is an example task for `Taskotron `_ +that tests the basic functionality of 'sscg --help' to confirm it generates a usage message. + +Standalone you can run it like this:: + + $ make run + +Through taskotron runner you can run it like this:: + + $ runtask -i sscg-2.0.4-1.fc27 -t koji_build -a x86_64 runtask.yml diff --git a/test/help-usage/runtask.yml b/test/help-usage/runtask.yml new file mode 100644 index 0000000..53be939 --- /dev/null +++ b/test/help-usage/runtask.yml @@ -0,0 +1,29 @@ +--- +name: help-usage +desc: "Tests the basic functionality of 'sscg --help' to confirm it generates a usage message." +maintainer: sgallagh + +input: + args: + - koji_build + - arch + +environment: + rpm: + - make + +actions: + - name: download the build + koji: + action: download + koji_build: ${koji_build} + arch: $arch + target_dir: ${workdir}/rpms + + - name: install the build + shell: + - dnf install -y ${workdir}/rpms/*.rpm + + - name: run test + shell: + - make run diff --git a/test/help-usage/runtest.sh b/test/help-usage/runtest.sh new file mode 100755 index 0000000..e4f1a8f --- /dev/null +++ b/test/help-usage/runtest.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +PACKAGE=sscg + +# Assume the test will pass. +result=PASS + +sscg --help | grep -q -i '^usage:' +if [ $? -ne 0 ]; then + result=FAIL +fi + +echo $result