Renaming test files according to their language (#3407)

This commit is contained in:
mattsmida 2024-05-01 14:28:07 -04:00 committed by GitHub
parent 43ca74549d
commit ef9613e2d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
178 changed files with 171 additions and 169 deletions

View file

@ -19,37 +19,37 @@ include_directories (${CMAKE_SOURCE_DIR}
${TASK_INCLUDE_DIRS}) ${TASK_INCLUDE_DIRS})
set (test_SRCS set (test_SRCS
col.t col.test.cpp
dom.t dom.test.cpp
eval.t eval.test.cpp
lexer.t lexer.test.cpp
t.t t.test.cpp
tw-2689.t tw-2689.test.cpp
tdb2.t tdb2.test.cpp
tc.t tc.test.cpp
util.t util.test.cpp
variant_add.t variant_add.test.cpp
variant_and.t variant_and.test.cpp
variant_cast.t variant_cast.test.cpp
variant_divide.t variant_divide.test.cpp
variant_equal.t variant_equal.test.cpp
variant_exp.t variant_exp.test.cpp
variant_gt.t variant_gt.test.cpp
variant_gte.t variant_gte.test.cpp
variant_inequal.t variant_inequal.test.cpp
variant_lt.t variant_lt.test.cpp
variant_lte.t variant_lte.test.cpp
variant_match.t variant_match.test.cpp
variant_math.t variant_math.test.cpp
variant_modulo.t variant_modulo.test.cpp
variant_multiply.t variant_multiply.test.cpp
variant_nomatch.t variant_nomatch.test.cpp
variant_not.t variant_not.test.cpp
variant_or.t variant_or.test.cpp
variant_partial.t variant_partial.test.cpp
variant_subtract.t variant_subtract.test.cpp
variant_xor.t variant_xor.test.cpp
view.t view.test.cpp
) )
add_custom_target (test ./run_all --verbose add_custom_target (test ./run_all --verbose
@ -60,7 +60,7 @@ add_custom_target (build_tests DEPENDS ${test_SRCS}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
foreach (src_FILE ${test_SRCS}) foreach (src_FILE ${test_SRCS})
add_executable (${src_FILE} "${src_FILE}.cpp" test.cpp) add_executable (${src_FILE} ${src_FILE} test.cpp)
target_link_libraries (${src_FILE} task tc commands columns libshared task tc commands columns libshared task commands columns libshared ${TASK_LIBRARIES}) target_link_libraries (${src_FILE} task tc commands columns libshared task tc commands columns libshared task commands columns libshared ${TASK_LIBRARIES})
if (DARWIN) if (DARWIN)
target_link_libraries (${src_FILE} "-framework CoreFoundation -framework Security -framework SystemConfiguration") target_link_libraries (${src_FILE} "-framework CoreFoundation -framework Security -framework SystemConfiguration")
@ -74,125 +74,126 @@ configure_file(bash_tap_tw.sh bash_tap_tw.sh COPYONLY)
add_subdirectory(basetest) add_subdirectory(basetest)
add_subdirectory(simpletap) add_subdirectory(simpletap)
set (pythonTests set (pythonTests
abbreviation.t abbreviation.test.py
add.t add.test.py
alias.t alias.test.py
annotate.t annotate.test.py
append.t append.test.py
args.t args.test.py
bash_completion.t bash_completion.test.py
blocked.t blocked.test.py
bulk.t bulk.test.py
burndown.t burndown.test.py
calc.t calc.test.py
calendar.t calendar.test.py
caseless.t caseless.test.py
color.cmd.t color.cmd.test.py
color.rules.t color.rules.test.py
columns.t columns.test.py
commands.t commands.test.py
completed.t completed.test.py
configuration.t configuration.test.py
confirmation.t confirmation.test.py
context.t context.test.py
count.t count.test.py
custom.config.t custom.config.test.py
custom.recur_ind.t custom.recur_ind.test.py
custom.t custom.test.py
custom.tag_ind.t custom.tag_ind.test.py
date.iso.t date.iso.test.py
dateformat.t dateformat.test.py
datesort.t datesort.test.py
datetime-negative.t datetime-negative.test.py
debug.t debug.test.py
default.t default.test.py
delete.t delete.test.py
denotate.t denotate.test.py
dependencies.t dependencies.test.py
diag.t diag.test.py
diag_color.t diag_color.test.py
dom2.t dom2.test.py
due.t due.test.py
duplicate.t duplicate.test.py
edit.t edit.test.py
encoding.t encoding.test.py
enpassant.t enpassant.test.py
exec.t exec.test.py
export.t export.test.py
feature.559.t feature.559.test.py
feature.default.project.t feature.default.project.test.py
feature.print.empty.columns.t feature.print.empty.columns.test.py
feature.recurrence.t feature.recurrence.test.py
feedback.t feedback.test.py
filter.t filter.test.py
fontunderline.t fontunderline.test.py
format.t format.test.py
gc.t gc.test.py
helpers.t helpers.test.py
history.t history.test.py
hooks.env.t hooks.env.test.py
hooks.on-add.t hooks.on-add.test.py
hooks.on-launch.t hooks.on-launch.test.py
hooks.on-modify.t hooks.on-modify.test.py
hyphenate.t hyphenate.test.py
ids.t ids.test.py
import.t import.test.py
info.t info.test.py
limit.t limit.test.py
list.all.projects.t list.all.projects.test.py
log.t log.test.py
logo.t logo.test.py
math.t math.test.py
modify.t modify.test.py
nag.t nag.test.py
obfuscate.t obfuscate.test.py
oldest.t oldest.test.py
operators.t operators.test.py
overdue.t overdue.test.py
partial.t partial.test.py
prepend.t prepend.test.py
pri_sort.t pri_sort.test.py
project.t project.test.py
quotes.t quotes.test.py
rc.override.t rc.override.test.py
recurrence.t recurrence.test.py
reports.t reports.test.py
search.t search.test.py
sequence.t sequence.test.py
shell.t shell.test.py
show.t show.test.py
sorting.t sorting.test.py
special.t special.test.py
start.t start.test.py
stats.t stats.test.py
substitute.t substitute.test.py
sugar.t sugar.test.py
summary.t summary.test.py
tag.t tag.test.py
taskrc.t taskrc.test.py
timesheet.t timesheet.test.py
tw-1379.t tw-1379.test.py
tw-1837.t tw-1837.test.py
tw-20.t tw-20.test.py
tw-2575.t tw-2575.test.py
tw-262.t tw-262.test.py
tw-295.t tw-295.test.py
uda.t uda.test.py
uda_orphan.t uda_orphan.test.py
uda_report.t uda_report.test.py
uda_sort.t uda_sort.test.py
undo.t undo.test.py
unicode.t unicode.test.py
unique.t unique.test.py
upgrade.t upgrade.test.py
urgency.t urgency.test.py
urgency_inherit.t urgency_inherit.test.py
uuid.t uuid.test.py
verbose.t verbose.test.py
version.t version.test.py
wait.t wait.test.py
hooks.on-exit.t hooks.on-exit.test.py
) )
foreach (python_Test ${pythonTests}) foreach (python_Test ${pythonTests})

View file

@ -38,19 +38,20 @@ There are three varieties of tests:
very fast tests, and are exhaustive in nature. very fast tests, and are exhaustive in nature.
* Python unit tests that are at the highest level, exercising the command * 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 line, hooks and syncing. There is an example, 'template.test.py', that
to perform various high level tests. shows how to perform various high level tests.
* Bash unit tests, one test per file, using the bash_tap_tw.sh script. These * 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. 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 All tests are named with the pattern '*.test.py', '*.test.sh', or '*.test.cpp',
the test harness. Additionally a test must be set executable (chmod +x) for it and any other forms are not run by the test harness. Additionally a test must
to be run. In the case of Python tests one can still run them manually by be set executable (chmod +x) for it to be run. In the case of Python tests one
launching them with 'python test.t' or simply './test.t'. It also allows us to can still run them manually by launching them with 'python testname.test.py' or
keep tests submitted for bugs that are not scheduled to be fixed in the simply './testname.test.py'. It also allows us to keep tests submitted for bugs
upcoming release, and we don't want the failing tests to prevent us from seeing that are not scheduled to be fixed in the upcoming release, and we don't want
100% pass rate for the bugs we *have* fixed. the failing tests to prevent us from seeing 100% pass rate for the bugs we
*have* fixed.
Goals Goals

View file

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
printf "C++: %5d\n" $(ls *.t.cpp | wc -l) printf "C++: %5d\n" $(ls *.test.cpp | wc -l)
printf "Python: %5d\n" $(head -n1 *.t | grep -a '\bpython' | wc -l) printf "Python: %5d\n" $(head -n1 *.test.py | grep -a '\bpython' | wc -l)
printf "Bash: %5d\n" $(head -n1 *.t | grep -a '\bbash' | wc -l) printf "Bash: %5d\n" $(head -n1 *.test.sh | grep -a '\bbash' | wc -l)
echo echo
printf "Feature %5d\n" $(ls feature.*.t | wc -l) printf "Feature %5d\n" $(ls feature.*.test.py | wc -l)
printf "Bug %5d\n" $(ls tw-*.t | wc -l) printf "Bug %5d\n" $(ls tw-*.test.sh | wc -l)
echo echo
printf "Total: %5d\n" $(ls *.t | wc -l) printf "Total: %5d\n" $(ls *.test.* | wc -l)

View file

@ -52,7 +52,7 @@ if __name__ == "__main__":
unexpected = defaultdict(int) unexpected = defaultdict(int)
passed = defaultdict(int) passed = defaultdict(int)
file = re.compile(r"^# (?:./)?(\S+\.t)(?:\.exe)?$") file = re.compile(r"^# (?:./)?(\S+\.test)(?:\.py|\.cpp)?$")
timestamp = re.compile(r"^# (\d+(?:\.\d+)?) ==>.*$") timestamp = re.compile(r"^# (\d+(?:\.\d+)?) ==>.*$")
expected_fail = re.compile(r"^not ok.*?#\s*TODO", re.I) expected_fail = re.compile(r"^not ok.*?#\s*TODO", re.I)

View file

@ -70,7 +70,7 @@ class TestRunner(object):
self._outputq = Queue() self._outputq = Queue()
def _find_tests(self): def _find_tests(self):
for test in glob.glob("*.t"): for test in glob.glob("*.test.sh") + glob.glob("*.test.py") + glob.glob("*.test.cpp"):
if os.access(test, os.X_OK): if os.access(test, os.X_OK):
# Executables only # Executables only
if self._is_parallelizable(test): if self._is_parallelizable(test):

Some files were not shown because too many files have changed in this diff Show more