Sync with upstream release 47.0.
Enable self-tests during build. Add example test to be run by Taskotron.
This commit is contained in:
parent
eab253d46e
commit
9f6f5dcf7f
7 changed files with 80 additions and 4 deletions
14
test/help-usage-1/Makefile
Normal file
14
test/help-usage-1/Makefile
Normal file
|
|
@ -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)
|
||||
13
test/help-usage-1/README.rst
Normal file
13
test/help-usage-1/README.rst
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
help-usage-1
|
||||
============
|
||||
|
||||
This is an example task for `Taskotron <https://fedoraproject.org/wiki/Taskotron>`_
|
||||
that tests the basic functionality of 'avocado --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 python-avocado-46.0-2.fc25 -t koji_build -a noarch runtask.yml
|
||||
29
test/help-usage-1/runtask.yml
Normal file
29
test/help-usage-1/runtask.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
name: help-usage-1
|
||||
desc: "Tests the basic functionality of 'avocado --help' to confirm it generates a usage message."
|
||||
maintainer: merlinm
|
||||
|
||||
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
|
||||
13
test/help-usage-1/runtest.sh
Executable file
13
test/help-usage-1/runtest.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
PACKAGE=python-avocado
|
||||
|
||||
# Assume the test will pass.
|
||||
result=PASS
|
||||
|
||||
avocado --help | grep -q -i '^usage:'
|
||||
if [ $? -ne 0 ]; then
|
||||
result=FAIL
|
||||
fi
|
||||
|
||||
echo $result
|
||||
Loading…
Add table
Add a link
Reference in a new issue