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})
set (test_SRCS
col.t
dom.t
eval.t
lexer.t
t.t
tw-2689.t
tdb2.t
tc.t
util.t
variant_add.t
variant_and.t
variant_cast.t
variant_divide.t
variant_equal.t
variant_exp.t
variant_gt.t
variant_gte.t
variant_inequal.t
variant_lt.t
variant_lte.t
variant_match.t
variant_math.t
variant_modulo.t
variant_multiply.t
variant_nomatch.t
variant_not.t
variant_or.t
variant_partial.t
variant_subtract.t
variant_xor.t
view.t
col.test.cpp
dom.test.cpp
eval.test.cpp
lexer.test.cpp
t.test.cpp
tw-2689.test.cpp
tdb2.test.cpp
tc.test.cpp
util.test.cpp
variant_add.test.cpp
variant_and.test.cpp
variant_cast.test.cpp
variant_divide.test.cpp
variant_equal.test.cpp
variant_exp.test.cpp
variant_gt.test.cpp
variant_gte.test.cpp
variant_inequal.test.cpp
variant_lt.test.cpp
variant_lte.test.cpp
variant_match.test.cpp
variant_math.test.cpp
variant_modulo.test.cpp
variant_multiply.test.cpp
variant_nomatch.test.cpp
variant_not.test.cpp
variant_or.test.cpp
variant_partial.test.cpp
variant_subtract.test.cpp
variant_xor.test.cpp
view.test.cpp
)
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)
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})
if (DARWIN)
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(simpletap)
set (pythonTests
abbreviation.t
add.t
alias.t
annotate.t
append.t
args.t
bash_completion.t
blocked.t
bulk.t
burndown.t
calc.t
calendar.t
caseless.t
color.cmd.t
color.rules.t
columns.t
commands.t
completed.t
configuration.t
confirmation.t
context.t
count.t
custom.config.t
custom.recur_ind.t
custom.t
custom.tag_ind.t
date.iso.t
dateformat.t
datesort.t
datetime-negative.t
debug.t
default.t
delete.t
denotate.t
dependencies.t
diag.t
diag_color.t
dom2.t
due.t
duplicate.t
edit.t
encoding.t
enpassant.t
exec.t
export.t
feature.559.t
feature.default.project.t
feature.print.empty.columns.t
feature.recurrence.t
feedback.t
filter.t
fontunderline.t
format.t
gc.t
helpers.t
history.t
hooks.env.t
hooks.on-add.t
hooks.on-launch.t
hooks.on-modify.t
hyphenate.t
ids.t
import.t
info.t
limit.t
list.all.projects.t
log.t
logo.t
math.t
modify.t
nag.t
obfuscate.t
oldest.t
operators.t
overdue.t
partial.t
prepend.t
pri_sort.t
project.t
quotes.t
rc.override.t
recurrence.t
reports.t
search.t
sequence.t
shell.t
show.t
sorting.t
special.t
start.t
stats.t
substitute.t
sugar.t
summary.t
tag.t
taskrc.t
timesheet.t
tw-1379.t
tw-1837.t
tw-20.t
tw-2575.t
tw-262.t
tw-295.t
uda.t
uda_orphan.t
uda_report.t
uda_sort.t
undo.t
unicode.t
unique.t
upgrade.t
urgency.t
urgency_inherit.t
uuid.t
verbose.t
version.t
wait.t
hooks.on-exit.t
abbreviation.test.py
add.test.py
alias.test.py
annotate.test.py
append.test.py
args.test.py
bash_completion.test.py
blocked.test.py
bulk.test.py
burndown.test.py
calc.test.py
calendar.test.py
caseless.test.py
color.cmd.test.py
color.rules.test.py
columns.test.py
commands.test.py
completed.test.py
configuration.test.py
confirmation.test.py
context.test.py
count.test.py
custom.config.test.py
custom.recur_ind.test.py
custom.test.py
custom.tag_ind.test.py
date.iso.test.py
dateformat.test.py
datesort.test.py
datetime-negative.test.py
debug.test.py
default.test.py
delete.test.py
denotate.test.py
dependencies.test.py
diag.test.py
diag_color.test.py
dom2.test.py
due.test.py
duplicate.test.py
edit.test.py
encoding.test.py
enpassant.test.py
exec.test.py
export.test.py
feature.559.test.py
feature.default.project.test.py
feature.print.empty.columns.test.py
feature.recurrence.test.py
feedback.test.py
filter.test.py
fontunderline.test.py
format.test.py
gc.test.py
helpers.test.py
history.test.py
hooks.env.test.py
hooks.on-add.test.py
hooks.on-launch.test.py
hooks.on-modify.test.py
hyphenate.test.py
ids.test.py
import.test.py
info.test.py
limit.test.py
list.all.projects.test.py
log.test.py
logo.test.py
math.test.py
modify.test.py
nag.test.py
obfuscate.test.py
oldest.test.py
operators.test.py
overdue.test.py
partial.test.py
prepend.test.py
pri_sort.test.py
project.test.py
quotes.test.py
rc.override.test.py
recurrence.test.py
reports.test.py
search.test.py
sequence.test.py
shell.test.py
show.test.py
sorting.test.py
special.test.py
start.test.py
stats.test.py
substitute.test.py
sugar.test.py
summary.test.py
tag.test.py
taskrc.test.py
timesheet.test.py
tw-1379.test.py
tw-1837.test.py
tw-20.test.py
tw-2575.test.py
tw-262.test.py
tw-295.test.py
uda.test.py
uda_orphan.test.py
uda_report.test.py
uda_sort.test.py
undo.test.py
unicode.test.py
unique.test.py
upgrade.test.py
urgency.test.py
urgency_inherit.test.py
uuid.test.py
verbose.test.py
version.test.py
wait.test.py
hooks.on-exit.test.py
)
foreach (python_Test ${pythonTests})
@ -202,4 +203,4 @@ endforeach(python_Test)
#SET(CMAKE_BUILD_TYPE gcov)
#SET(CMAKE_CXX_FLAGS_GCOV "--coverage")
#SET(CMAKE_C_FLAGS_GCOV "--coverage")
#SET(CMAKE_EXE_LINKER_FLAGS_GCOV "--coverage")
#SET(CMAKE_EXE_LINKER_FLAGS_GCOV "--coverage")

View file

@ -38,19 +38,20 @@ There are three varieties of tests:
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.
line, hooks and syncing. There is an example, 'template.test.py', 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.
All tests are named with the pattern '*.test.py', '*.test.sh', or '*.test.cpp',
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 testname.test.py' or
simply './testname.test.py'. 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

View file

@ -1,10 +1,10 @@
#!/bin/sh
printf "C++: %5d\n" $(ls *.t.cpp | wc -l)
printf "Python: %5d\n" $(head -n1 *.t | grep -a '\bpython' | wc -l)
printf "Bash: %5d\n" $(head -n1 *.t | grep -a '\bbash' | wc -l)
printf "C++: %5d\n" $(ls *.test.cpp | wc -l)
printf "Python: %5d\n" $(head -n1 *.test.py | grep -a '\bpython' | wc -l)
printf "Bash: %5d\n" $(head -n1 *.test.sh | grep -a '\bbash' | wc -l)
echo
printf "Feature %5d\n" $(ls feature.*.t | wc -l)
printf "Bug %5d\n" $(ls tw-*.t | wc -l)
printf "Feature %5d\n" $(ls feature.*.test.py | wc -l)
printf "Bug %5d\n" $(ls tw-*.test.sh | wc -l)
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)
passed = defaultdict(int)
file = re.compile(r"^# (?:./)?(\S+\.t)(?:\.exe)?$")
file = re.compile(r"^# (?:./)?(\S+\.test)(?:\.py|\.cpp)?$")
timestamp = re.compile(r"^# (\d+(?:\.\d+)?) ==>.*$")
expected_fail = re.compile(r"^not ok.*?#\s*TODO", re.I)

View file

@ -70,7 +70,7 @@ class TestRunner(object):
self._outputq = Queue()
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):
# Executables only
if self._is_parallelizable(test):

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