taskwarrior/test
2018-05-14 00:44:34 -04:00
..
basetest Tests: Removed taskd group features from test framework 2018-05-13 23:04:47 -04:00
simpletap Copyright 2018 2018-05-13 23:30:21 -04:00
test_certs PKI: Updated test_client 2018-05-13 22:22:23 -04:00
test_hooks Tests: Add failing on-modify hook 2015-09-04 21:39:08 +02:00
.gitignore Tests: Added first DOM test 2018-05-13 23:18:17 -04:00
abbreviation.t Copyright 2018 2018-05-13 23:30:21 -04:00
add.t Copyright 2018 2018-05-13 23:30:21 -04:00
alias.t Copyright 2018 2018-05-13 23:30:21 -04:00
annotate.t Copyright 2018 2018-05-13 23:30:21 -04:00
append.t Copyright 2018 2018-05-13 23:30:21 -04:00
args.t Copyright 2018 2018-05-13 23:30:21 -04:00
backlog.t Copyright 2018 2018-05-13 23:30:21 -04:00
bash_completion.t Copyright 2018 2018-05-13 23:30:21 -04:00
bash_tap.sh Copyright 2018 2018-05-13 23:30:21 -04:00
bash_tap_tw.sh Copyright 2018 2018-05-13 23:30:21 -04:00
blocked.t Copyright 2018 2018-05-13 23:30:21 -04:00
bulk.t Copyright 2018 2018-05-13 23:30:21 -04:00
burndown.t Copyright 2018 2018-05-13 23:30:21 -04:00
calc.t Copyright 2018 2018-05-13 23:30:21 -04:00
calendar.t Copyright 2018 2018-05-13 23:30:21 -04:00
caseless.t Copyright 2018 2018-05-13 23:30:21 -04:00
CMakeLists.txt Tests: Added first DOM test 2018-05-13 23:18:17 -04:00
col.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
color.cmd.t Copyright 2018 2018-05-13 23:30:21 -04:00
color.rules.t Tests: Fixed broken color merge tests 2018-05-14 00:34:22 -04:00
columns.t Copyright 2018 2018-05-13 23:30:21 -04:00
commands.t Copyright 2018 2018-05-13 23:30:21 -04:00
completed.t Copyright 2018 2018-05-13 23:30:21 -04:00
configuration.t Copyright 2018 2018-05-13 23:30:21 -04:00
confirmation.t Copyright 2018 2018-05-13 23:30:21 -04:00
context.t Copyright 2018 2018-05-13 23:30:21 -04:00
conversion Test: Fixed error in conversion now there are no more bug.*.t scripts 2015-10-23 09:19:45 -04:00
count.t Copyright 2018 2018-05-13 23:30:21 -04:00
custom.config.t Copyright 2018 2018-05-13 23:30:21 -04:00
custom.recur_ind.t Copyright 2018 2018-05-13 23:30:21 -04:00
custom.t Copyright 2018 2018-05-13 23:30:21 -04:00
custom.tag_ind.t Copyright 2018 2018-05-13 23:30:21 -04:00
date.iso.t Copyright 2018 2018-05-13 23:30:21 -04:00
dateformat.t Copyright 2018 2018-05-13 23:30:21 -04:00
datesort.t Copyright 2018 2018-05-13 23:30:21 -04:00
datetime-negative.t Copyright 2018 2018-05-13 23:30:21 -04:00
debug.t Copyright 2018 2018-05-13 23:30:21 -04:00
default.t Copyright 2018 2018-05-13 23:30:21 -04:00
delete.t Copyright 2018 2018-05-13 23:30:21 -04:00
denotate.t Copyright 2018 2018-05-13 23:30:21 -04:00
dependencies.t Copyright 2018 2018-05-13 23:30:21 -04:00
diag.t Copyright 2018 2018-05-13 23:30:21 -04:00
diag_color.t Copyright 2018 2018-05-13 23:30:21 -04:00
dom.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
dom2.t Copyright 2018 2018-05-13 23:30:21 -04:00
due.t Copyright 2018 2018-05-13 23:30:21 -04:00
duplicate.t Copyright 2018 2018-05-13 23:30:21 -04:00
edit.t Copyright 2018 2018-05-13 23:30:21 -04:00
encoding.t Copyright 2018 2018-05-13 23:30:21 -04:00
enpassant.t Copyright 2018 2018-05-13 23:30:21 -04:00
eval.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
exec.t Copyright 2018 2018-05-13 23:30:21 -04:00
export.t Copyright 2018 2018-05-13 23:30:21 -04:00
feature.559.t Copyright 2018 2018-05-13 23:30:21 -04:00
feature.default.project.t Copyright 2018 2018-05-13 23:30:21 -04:00
feature.print.empty.columns.t Copyright 2018 2018-05-13 23:30:21 -04:00
feature.recurrence.t Copyright 2018 2018-05-13 23:30:21 -04:00
feedback.t Copyright 2018 2018-05-13 23:30:21 -04:00
filter.t Copyright 2018 2018-05-13 23:30:21 -04:00
fontunderline.t Copyright 2018 2018-05-13 23:30:21 -04:00
format.t Copyright 2018 2018-05-13 23:30:21 -04:00
gc.t Copyright 2018 2018-05-13 23:30:21 -04:00
helpers.t Copyright 2018 2018-05-13 23:30:21 -04:00
history.t Copyright 2018 2018-05-13 23:30:21 -04:00
hooks.env.t Copyright 2018 2018-05-13 23:30:21 -04:00
hooks.on-add.t Copyright 2018 2018-05-13 23:30:21 -04:00
hooks.on-exit.t Copyright 2018 2018-05-13 23:30:21 -04:00
hooks.on-launch.t Copyright 2018 2018-05-13 23:30:21 -04:00
hooks.on-modify.t Copyright 2018 2018-05-13 23:30:21 -04:00
hyphenate.t Copyright 2018 2018-05-13 23:30:21 -04:00
ids.t Copyright 2018 2018-05-13 23:30:21 -04:00
import.t Copyright 2018 2018-05-13 23:30:21 -04:00
info.t Copyright 2018 2018-05-13 23:30:21 -04:00
lexer.t.cpp Lexer: Migrated to unicodeWhitespace 2018-05-14 00:35:17 -04:00
limit.t Copyright 2018 2018-05-13 23:30:21 -04:00
list.all.projects.t Copyright 2018 2018-05-13 23:30:21 -04:00
log.t Copyright 2018 2018-05-13 23:30:21 -04:00
logo.t Copyright 2018 2018-05-13 23:30:21 -04:00
math.t Copyright 2018 2018-05-13 23:30:21 -04:00
modify.t Copyright 2018 2018-05-13 23:30:21 -04:00
nag.t Copyright 2018 2018-05-13 23:30:21 -04:00
obfuscate.t Copyright 2018 2018-05-13 23:30:21 -04:00
oldest.t Copyright 2018 2018-05-13 23:30:21 -04:00
operators.t TW-1947: "urgency.over" filter seems to not work correct 2018-05-14 00:34:46 -04:00
overdue.t Copyright 2018 2018-05-13 23:30:21 -04:00
partial.t Copyright 2018 2018-05-13 23:30:21 -04:00
prepend.t Copyright 2018 2018-05-13 23:30:21 -04:00
pri_sort.t Copyright 2018 2018-05-13 23:30:21 -04:00
problems test/problems: Updated to handle TAP spec output 2018-05-13 23:25:11 -04:00
project.t Copyright 2018 2018-05-13 23:30:21 -04:00
purge.t Copyright 2018 2018-05-13 23:30:21 -04:00
quotes.t Copyright 2018 2018-05-13 23:30:21 -04:00
rc.override.t Copyright 2018 2018-05-13 23:30:21 -04:00
README Docs: Updated URLs 2018-05-14 00:44:34 -04:00
recurrence.t Copyright 2018 2018-05-13 23:30:21 -04:00
reports.t Copyright 2018 2018-05-13 23:30:21 -04:00
run_all Tests: Set sys.stdout as utf8 2018-05-13 20:23:05 -04:00
search.t Copyright 2018 2018-05-13 23:30:21 -04:00
sequence.t Copyright 2018 2018-05-13 23:30:21 -04:00
shell.t Copyright 2018 2018-05-13 23:30:21 -04:00
show.t Copyright 2018 2018-05-13 23:30:21 -04:00
sorting.t Copyright 2018 2018-05-13 23:30:21 -04:00
special.t Copyright 2018 2018-05-13 23:30:21 -04:00
start.t Copyright 2018 2018-05-13 23:30:21 -04:00
stats.t Copyright 2018 2018-05-13 23:30:21 -04:00
stress_test Test: More Python 3 compatibility changes in accessory files 2015-07-17 19:27:58 +01:00
substitute.t Copyright 2018 2018-05-13 23:30:21 -04:00
sugar.t Copyright 2018 2018-05-13 23:30:21 -04:00
summary.t Copyright 2018 2018-05-13 23:30:21 -04:00
t.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
tag.t Copyright 2018 2018-05-13 23:30:21 -04:00
taskrc.t Copyright 2018 2018-05-13 23:30:21 -04:00
tdb2.t.cpp Copyright 2018 2018-05-13 23:30:21 -04:00
template.t Copyright 2018 2018-05-13 23:30:21 -04:00
test.cpp Copyright 2018 2018-05-13 23:30:21 -04:00
test.h Copyright 2018 2018-05-13 23:30:21 -04:00
timesheet.t Copyright 2018 2018-05-13 23:30:21 -04:00
tw-20.t Copyright 2018 2018-05-13 23:30:21 -04:00
tw-46.t Copyright 2018 2018-05-13 23:30:21 -04:00
tw-262.t Copyright 2018 2018-05-13 23:30:21 -04:00
tw-295.t Copyright 2018 2018-05-13 23:30:21 -04:00
tw-1379.t Copyright 2018 2018-05-13 23:30:21 -04:00
tw-1637.t Test: Added explanation 2015-07-25 14:06:32 -04:00
tw-1643.t TW-1643: Add failing test 2015-07-30 13:13:38 +02:00
tw-1688.t Test: Simplify tw-1688.t 2015-09-11 17:22:00 +02:00
tw-1715.t TW-1715: No UDA needed, same problem with core attributes 2015-10-16 10:08:13 +02:00
tw-1718.t TW-1718: Test for "String UDA not passed through unchanged" 2015-10-26 09:50:54 +01:00
tw-1837.t Copyright 2018 2018-05-13 23:30:21 -04:00
uda.t Copyright 2018 2018-05-13 23:30:21 -04:00
uda_orphan.t Copyright 2018 2018-05-13 23:30:21 -04:00
uda_report.t Copyright 2018 2018-05-13 23:30:21 -04:00
uda_sort.t Copyright 2018 2018-05-13 23:30:21 -04:00
undo.t Copyright 2018 2018-05-13 23:30:21 -04:00
unicode.t Copyright 2018 2018-05-13 23:30:21 -04:00
unique.t Copyright 2018 2018-05-13 23:30:21 -04:00
upgrade.t Copyright 2018 2018-05-13 23:30:21 -04:00
urgency.t Copyright 2018 2018-05-13 23:30:21 -04:00
urgency_inherit.t Copyright 2018 2018-05-13 23:30:21 -04:00
util.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
uuid.t Copyright 2018 2018-05-13 23:30:21 -04:00
variant_add.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_and.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_cast.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_divide.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_equal.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_exp.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_gt.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_gte.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_inequal.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_lt.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_lte.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_match.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_math.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_modulo.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_multiply.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_nomatch.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_not.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_or.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_partial.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_subtract.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
variant_xor.t.cpp Portability: Updated to make main re-entrant() 2018-05-14 00:40:59 -04:00
verbose.t Copyright 2018 2018-05-13 23:30:21 -04:00
version.t Copyright 2018 2018-05-13 23:30:21 -04:00
view.t.cpp Copyright 2018 2018-05-13 23:30:21 -04:00
wait.t Copyright 2018 2018-05-13 23:30:21 -04:00

README
======

This is the task.git/test/README file, and contains notes about the Taskwarrior
test suite.


Running Tests
-------------

Do this to run all tests:

  $ cd test && make && ./run_all && ./problems

All unit tests produce TAP (Test Anything Protocol) output, and are run by the
'run_all' test harness.

The 'run_all' script produces an 'all.log' file which is the accumulated output
of all tests. Before executing 'run_all' you need to compile the C++ unit
tests, by running 'make' in the 'test' directory.

The script 'problems' will list all the tests that fail, with a count of the
failing tests, once you have run all the tests and produced an 'all.log' file.

Any TAP harness may be used.

Note that adding the '--serial' option to ./run_all, all tests are executed
serially.  The default runs Python, C++ and Bash tests in parallel. Using
'--serial' will make for a slower test run.


Architecture
------------

There are three varieties of tests:

  * C++ unit tests that test low-level object interfaces. These are typically
    very fast tests, and are exhaustive in nature.

  * Python unit tests that are at the highest level, exercising the command
    line, hooks and syncing. There is an example, 'template.t', that shows how
    to perform various high level tests.

  * Bash unit tests, one test per file, using the bash_tap_tw.sh script. These
    tests are small, quick tests, not intended to be permanent.

All tests are named with the pattern '*.t', and any other forms are not run by
the test harness. Additionally a test must be set executable (chmod +x) for it
to be run. In the case of Python tests one can still run them manually by
launching them with 'python test.t' or simply './test.t'. It also allows us to
keep tests submitted for bugs that are not scheduled to be fixed in the
upcoming release, and we don't want the failing tests to prevent us from seeing
100% pass rate for the bugs we *have* fixed.


Goals
-----

The test suite is evolving, and becoming a better tool for determining whether
code is ready for release. There are goals that shape these changes, and they
are:

  * Increase test coverage by testing more features, more thoroughly. The test
    coverage level is (as of 2016-07-24) at 86.5%.

  * Write fewer bug regression tests. Over time, bug regression tests are less
    useful than feature tests, and more likely to contain overlapping coverage.

  * Eliminate obsolete tests, which are tests that have overlapping coverage.
    There is simply no point in testing a feature twice, in the same manner.


What Makes a Good Test
----------------------

A good test ensures that a feature is functioning as expected, and contains
both positive and negative aspects, or in other words looks for expected
behavior as well as looking for the absence of unexpected behavior.


Conventions for writing a test
------------------------------

If you wish to contribute tests, please consider the following guidelines:

  * For a new bug, an accompanying test is very helpful.  Suppose you write up
    a bug, named TW-1234, then the test would be a script named tw-1234.t, and
    based on the template.t example.

    Over time, we will migrate the tests in tw-1234.t into a feature-specific
    test script, such as filter.t, export.t, whichever is appropriate.

  * Tests created after bugs or feature requests should (ideally) have an entry
    on https://github.com/GothenburgBitFactory/taskwarrior/issues and should
    include the issue ID in a docstring or comment.

  * Class and method names should be descriptive of what they are testing.
    Example: TestFilterOnReports

  * Docstrings on Python tests are mandatory. The first line is used as title
    of the test. Include the issue ID - there are many examples of this.

  * Extra information and details should go into multi-line docstrings or
    comments.

  * Python tests for bugs or features not yet fixed/implemented should be
    decorated with: @unittest.skip("WaitingFor TW-xxxx"). We would rather have
    a live test that is skipped, than no test.


How to Submit a Test Change/Addition
------------------------------------

Mail it to support@taskwarrior.org, or attach it to an open bug.


Wisdom
------

Here are some guildelines that may help:

  * If there are any lexer.t tests failing, then ignore all the others and fix
    these first. They are fundamental and affect everything else. One Lexer
    failure can cause 30 symptomatic failures, and addressing any of those is
    wrong.

  * If any of the C++ tests fail, fix them next, for the same reason as above.

  * If you are about to fix a bug, and no tests are failing, add tests that fail
    in a script named tw-XXXX.t. Later, someone will incorporate that test
    script into higher-level feature tests.

  * If the command line parser is not working, start by blaming the Lexer.

  * While the lowest level (C++) tests should be exhaustive, higher level tests
    should not do the same by iterating over the entire problem space. It is a
    waste of time.

  * If you find that you are combining two features into one test, you are
    probably doing it wrong.

  * If you add a feature, then add a test to prove it works, also add a test to
    prove it doesn't simultaneously generate errors. Furthermore test that with
    the feature disabled, or command line arguments missing, appropriate errors
    are reported.


TODO
----

For anyone looking for test-related tasks to take on, here are some suggestions:

  * Find and eliminate duplicate tests.

  * Using <attribute>.startswith:<value> with rc.regex:off still uses regex.

  * Crazy dateformat values are not tested.

  * Invalid UTF8 is not tested.

  * All the attribute modifiers need to be tested, only a few are.

  * Aliases are not well tested, and fragile.

---