]> https://gitweb.dealii.org/ - dealii.git/commit
Remove duplicated tests.
authorDavid Wells <wellsd2@rpi.edu>
Sun, 21 Aug 2016 17:54:14 +0000 (13:54 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Thu, 25 Aug 2016 21:46:29 +0000 (17:46 -0400)
commit0e74ac535d31d753dcf01a8fae35a98fc015fb09
tree47fee8e81cbfaaa9c3cf378752e99ca950580ca8
parentc0032cb21169706fbac2598d77e6ab24c845a8a9
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
32 files changed:
tests/bits/block_sparse_matrix_iterator_03.cc [deleted file]
tests/bits/block_sparse_matrix_iterator_03.output [deleted file]
tests/bits/sparse_matrix_01a.cc [deleted file]
tests/bits/sparse_matrix_01a.output [deleted file]
tests/bits/step-16b.cc [deleted file]
tests/bits/step-16b.output [deleted file]
tests/bits/vector_25.cc [deleted file]
tests/bits/vector_25.output [deleted file]
tests/dofs/dof_constraints_06_x.cc [deleted file]
tests/dofs/dof_constraints_06_x.output [deleted file]
tests/dofs/dof_constraints_10_x.cc [deleted file]
tests/dofs/dof_constraints_10_x.output [deleted file]
tests/dofs/sparsity_pattern_01_x.cc [deleted file]
tests/dofs/sparsity_pattern_01_x.output [deleted file]
tests/dofs/sparsity_pattern_x.cc [deleted file]
tests/dofs/sparsity_pattern_x.output [deleted file]
tests/fe/fe_support_points_q_qg0.cc [deleted file]
tests/fe/fe_support_points_q_qg0.output [deleted file]
tests/fe/fe_values_view_10_single_04.cc [deleted file]
tests/fe/fe_values_view_10_single_04.output [deleted file]
tests/full_matrix/complex_complex_full_matrix_05.cc [deleted file]
tests/full_matrix/complex_complex_full_matrix_05.output [deleted file]
tests/full_matrix/complex_complex_full_matrix_09.cc [deleted file]
tests/full_matrix/complex_complex_full_matrix_09.output [deleted file]
tests/grid/have_same_coarse_mesh_04.cc [deleted file]
tests/grid/have_same_coarse_mesh_04.output [deleted file]
tests/matrix_free/matrix_vector_14b.cc [deleted file]
tests/matrix_free/matrix_vector_14b.output [deleted file]
tests/petsc/25.cc [deleted file]
tests/petsc/25.output [deleted file]
tests/trilinos/25.cc [deleted file]
tests/trilinos/25.output [deleted file]

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.