Remove duplicated tests.
This commit continues the work started in
b9c64f0dac and removes tests
that are identical up to things the compiler sees (e.g., tests that are
the same aside from commenting or formatting). I did this by deleting
comments with the preprocessor and then running the result through
clang-format.
For the sake of posterity: I compiled this list by executing the python
script
#!/usr/bin/env python
import atexit
import hashlib
import os
import shutil
import subprocess
import sys
import tempfile
def main():
current_test_file_name = sys.argv[1]
preprocessed_file_name = "/tmp/unique_file_name.cc"
subprocess.check_call(
["g++",
"-fpreprocessed", "-dD", "-E",
current_test_file_name,
"-o", preprocessed_file_name],
stderr=sys.stderr)
atexit.register(lambda name=preprocessed_file_name: os.remove(name))
# get rid of any line number indicators cpp may have left
subprocess.check_call(["sed", "-i", "/^# [0-9]/d", preprocessed_file_name],
stderr=sys.stderr)
# reformat source to canonical form
subprocess.check_call(["clang-format", "-i", preprocessed_file_name])
md5sum = hashlib.md5()
with open(preprocessed_file_name, "rb") as preprocessed_file_handle:
for block in iter(lambda: preprocessed_file_handle.read(65536), b""):
md5sum.update(block)
print(md5sum.hexdigest(), current_test_file_name)
if __name__ == '__main__':
main()
in the shell command
find ./ -name '*.cc' | grep -v all-headers | xargs -I% python formatted_md5.py \
% | tee preprocessed-md5.txt
and then sorted the results with the shell command
awk '{print $2, $1}' preprocessed-md5.txt | sort --key=2,2 \
| uniq --all-repeated=separate --skip-fields=1
What follows is a brief description of why each test was removed:
bits/block_sparse_matrix_iterator_03.cc
Same as bits/block_sparse_matrix_iterator_02.cc (up to a comment)
bits/sparse_matrix_01a.cc
Identical (up to a comment) to bits/sparse_matrix_01.cc
bits/step-16b.cc
Identical (up to a comment) to bits/step-16.cc
bits/vector_25.cc
Identical (up to a comment) to bits/vector_24.cc
The tests
dofs/dof_constraints_06_x.cc
dofs/dof_constraints_10_x.cc
dofs/sparsity_pattern_x.cc
dofs/sparsity_pattern_01_x.cc
were all duplicates (up to comments) of tests without '_x's in their
names. This was a result of deleting CompressedSparsityPattern et al.
fe/fe_support_points_q_qg0.cc
Identical (up to a blank line) to fe/fe_support_points_q_dg0.cc
fe/fe_values_view_10_single_04.cc
Identical (up to some code formatting and a comment) to
fe/fe_values_view_08.cc
The tests
full_matrix/complex_complex_full_matrix_05.cc
full_matrix/complex_complex_full_matrix_09.cc
were duplicates of the corresponding 'complex_real_full_matrix_*.cc'
test. Since the full matrices were real valued I kept the other ones.
grid/have_same_coarse_mesh_04.cc
Completely identical to grid/have_same_coarse_mesh_02.cc
matrix_free/matrix_vector_14b.cc
This test claims it uses more quadrature points than
matrix_free/matrix_vector_14.cc, but does not (and changing the number
of quadrature points is nontrivial for this test)
petsc/25.cc
Identical (up to a comment) to petsc/24.cc
trilinos/25.cc
Identical (up to a comment) to trilinos/24.cc