Skip to content

Commit

Permalink
examples: Add a folder with simple tests
Browse files Browse the repository at this point in the history
This fixes #628.

Add a couple of simple shell scripts that can be listed
and executed with avocado. Let's update our documentation
to use this new dir and avoid people confused with our
wrappers.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
  • Loading branch information
lmr committed Jul 7, 2015
1 parent e0de5e4 commit 8b1ae41
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions avocado.spec
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ examples of how to write tests on your own.

%files examples
%{_datadir}/avocado/tests
%{_datadir}/avocado/simpletests
%{_datadir}/avocado/wrappers

%changelog
Expand Down
10 changes: 3 additions & 7 deletions docs/source/GetStartedGuide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,9 @@ tests.
Let's now list a directory with a bunch of executable shell
scripts::

$ avocado list /usr/share/avocado/examples/wrappers
SIMPLE examples/wrappers/dummy.sh
SIMPLE examples/wrappers/ltrace.sh
SIMPLE examples/wrappers/perf.sh
SIMPLE examples/wrappers/strace.sh
SIMPLE examples/wrappers/time.sh
SIMPLE examples/wrappers/valgrind.sh
$ avocado list /usr/share/avocado/simpletests/
SIMPLE /usr/share/avocado/simpletests/failtest.sh
SIMPLE /usr/share/avocado/simpletests/passtest.sh

Here, as mentioned before, ``SIMPLE`` means that those files are executables
treated as simple tests. You can also give the ``--verbose`` or ``-V`` flag to
Expand Down
3 changes: 3 additions & 0 deletions examples/simpletests/failtest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
false

3 changes: 3 additions & 0 deletions examples/simpletests/passtest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
true

5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ def get_data_files():
data_files += [(get_dir(['usr', 'share', 'avocado', 'wrappers'],
['wrappers']),
glob.glob('examples/wrappers/*.sh'))]

data_files += [(get_dir(['usr', 'share', 'avocado', 'simpletests'],
['simpletests']),
glob.glob('examples/simpletests/*.sh'))]

data_files.append((get_avocado_libexec_dir(), glob.glob('libexec/*')))
return data_files

Expand Down

0 comments on commit 8b1ae41

Please sign in to comment.