Skip to content

Commit

Permalink
Renaming test files to comply with Google style guide.
Browse files Browse the repository at this point in the history
Also posfixing test files with `_test' to make it more clear.
  • Loading branch information
antiagainst committed Nov 7, 2016
1 parent bf190ec commit 4f57e14
Show file tree
Hide file tree
Showing 86 changed files with 174 additions and 171 deletions.
121 changes: 61 additions & 60 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,61 +62,62 @@ function(add_spvtools_unittest)
endfunction()

set(TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/TestFixture.h
${CMAKE_CURRENT_SOURCE_DIR}/UnitSPIRV.h
test_fixture.h
unit_spirv.h

${CMAKE_CURRENT_SOURCE_DIR}/AssemblyContext.cpp
${CMAKE_CURRENT_SOURCE_DIR}/AssemblyFormat.cpp
${CMAKE_CURRENT_SOURCE_DIR}/BinaryDestroy.cpp
${CMAKE_CURRENT_SOURCE_DIR}/BinaryEndianness.cpp
${CMAKE_CURRENT_SOURCE_DIR}/BinaryHeaderGet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/BinaryParse.cpp
${CMAKE_CURRENT_SOURCE_DIR}/BinaryToText.cpp
${CMAKE_CURRENT_SOURCE_DIR}/BinaryToText.Literal.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CapabilitySet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Comment.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ExtInstGLSLstd450.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ExtInst.OpenCL.std.cpp
${CMAKE_CURRENT_SOURCE_DIR}/FixWord.cpp
${CMAKE_CURRENT_SOURCE_DIR}/GeneratorMagicNumber.cpp
${CMAKE_CURRENT_SOURCE_DIR}/HexFloat.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ImmediateInt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/LibspirvMacros.cpp
${CMAKE_CURRENT_SOURCE_DIR}/NamedId.cpp
${CMAKE_CURRENT_SOURCE_DIR}/NameMapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/OpcodeMake.cpp
${CMAKE_CURRENT_SOURCE_DIR}/OpcodeRequiresCapabilities.cpp
${CMAKE_CURRENT_SOURCE_DIR}/OpcodeSplit.cpp
${CMAKE_CURRENT_SOURCE_DIR}/OpcodeTableGet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/OperandCapabilities.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Operand.cpp
${CMAKE_CURRENT_SOURCE_DIR}/OperandPattern.cpp
${CMAKE_CURRENT_SOURCE_DIR}/SoftwareVersion.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TargetEnv.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextAdvance.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextDestroy.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextLiteral.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextStartsNewInst.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Annotation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Barrier.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Constant.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.ControlFlow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Debug.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.DeviceSideEnqueue.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Extension.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Function.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Group.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Image.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Literal.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Memory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.Miscellaneous.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.ModeSetting.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.PipeStorage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.TypeDeclaration.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextToBinary.SubgroupDispatch.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TextWordGet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/UnitSPIRV.cpp
assembly_context_test.cpp
assembly_format_test.cpp
binary_destroy_test.cpp
binary_endianness_test.cpp
binary_header_get_test.cpp
binary_parse_test.cpp
binary_to_text_test.cpp
binary_to_text.literal_test.cpp
capability_set_test.cpp
comment_test.cpp
ext_inst.glsl_test.cpp
ext_inst.opencl_test.cpp
fix_word_test.cpp
generator_magic_number_test.cpp
hex_float_test.cpp
immediate_int_test.cpp
libspirv_macros_test.cpp
named_id_test.cpp
name_mapper_test.cpp
opcode_make_test.cpp
opcode_require_capabilities_test.cpp
opcode_split_test.cpp
opcode_table_get_test.cpp
operand_capabilities_test.cpp
operand_test.cpp
operand_pattern_test.cpp
software_version_test.cpp
target_env_test.cpp
text_advance_test.cpp
text_destroy_test.cpp
text_literal_test.cpp
text_start_new_inst_test.cpp
text_to_binary.annotation_test.cpp
text_to_binary.barrier_test.cpp
text_to_binary.constant_test.cpp
text_to_binary.control_flow_test.cpp
text_to_binary_test.cpp
text_to_binary.debug_test.cpp
text_to_binary.device_side_enqueue_test.cpp
text_to_binary.extension_test.cpp
text_to_binary.function_test.cpp
text_to_binary.group_test.cpp
text_to_binary.image_test.cpp
text_to_binary.literal_test.cpp
text_to_binary.memory_test.cpp
text_to_binary.misc_test.cpp
text_to_binary.mode_setting_test.cpp
text_to_binary.pipe_storage_test.cpp
text_to_binary.type_declaration_test.cpp
text_to_binary.subgroup_dispatch_test.cpp
text_word_get_test.cpp

unit_spirv.cpp
)

add_spvtools_unittest(
Expand All @@ -126,27 +127,27 @@ add_spvtools_unittest(

add_spvtools_unittest(
TARGET diagnostic
SRCS diagnostic.cpp
SRCS diagnostic_test.cpp
LIBS ${SPIRV_TOOLS})

add_spvtools_unittest(
TARGET c_interface
SRCS c_interface.cpp
SRCS c_interface_test.cpp
LIBS ${SPIRV_TOOLS})

add_spvtools_unittest(
TARGET cpp_interface
SRCS cpp_interface.cpp
LIBS SPIRV-Tools-opt ${SPIRV_TOOLS})
SRCS cpp_interface_test.cpp
LIBS SPIRV-Tools-opt)

add_spvtools_unittest(
TARGET parse_number
SRCS ${CMAKE_CURRENT_SOURCE_DIR}/ParseNumber.cpp
SRCS parse_number_test.cpp
LIBS ${SPIRV_TOOLS})

add_spvtools_unittest(
TARGET log
SRCS test_log.cpp
SRCS log_test.cpp
LIBS ${SPIRV_TOOLS})

add_subdirectory(opt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

#include <vector>
#include <gmock/gmock.h>
Expand Down
2 changes: 1 addition & 1 deletion test/AssemblyFormat.cpp → test/assembly_format_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "TestFixture.h"
#include "test_fixture.h"

namespace {

Expand Down
4 changes: 2 additions & 2 deletions test/BinaryDestroy.cpp → test/binary_destroy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

#include "TestFixture.h"
#include "test_fixture.h"

namespace {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

namespace {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

#include "source/spirv_constant.h"
#include "UnitSPIRV.h"
#include "unit_spirv.h"

namespace {

Expand Down
4 changes: 2 additions & 2 deletions test/BinaryParse.cpp → test/binary_parse_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include <string>
#include <vector>

#include "TestFixture.h"
#include "UnitSPIRV.h"
#include "test_fixture.h"
#include "unit_spirv.h"
#include "gmock/gmock.h"
#include "source/message.h"
#include "source/table.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

#include "gmock/gmock.h"
#include "TestFixture.h"
#include "test_fixture.h"

using ::testing::Eq;

Expand Down
4 changes: 2 additions & 2 deletions test/BinaryToText.cpp → test/binary_to_text_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

#include <sstream>

#include "gmock/gmock.h"

#include "TestFixture.h"
#include "test_fixture.h"
#include "source/spirv_constant.h"

namespace {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/CapabilitySet.cpp → test/capability_set_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "gmock/gmock.h"

#include "enum_set.h"
#include "UnitSPIRV.h"
#include "unit_spirv.h"

namespace {

Expand Down
4 changes: 2 additions & 2 deletions test/Comment.cpp → test/comment_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

#include "gmock/gmock.h"
#include "TestFixture.h"
#include "UnitSPIRV.h"
#include "test_fixture.h"
#include "unit_spirv.h"

namespace {

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/diagnostic.cpp → test/diagnostic_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion test/ExtInstGLSLstd450.cpp → test/ext_inst.glsl_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <algorithm>
#include <vector>

#include "UnitSPIRV.h"
#include "unit_spirv.h"
#include "spirv/1.0/GLSL.std.450.h"

namespace {
Expand Down
4 changes: 2 additions & 2 deletions test/ExtInst.OpenCL.std.cpp → test/ext_inst.opencl_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

#include <gmock/gmock.h>
#include "TestFixture.h"
#include "test_fixture.h"
#include "spirv/1.0/OpenCL.std.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion test/FixWord.cpp → test/fix_word_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

namespace {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

#include <gmock/gmock.h>

Expand Down
2 changes: 2 additions & 0 deletions test/HexFloat.cpp → test/hex_float_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
#include <tuple>

#include <gmock/gmock.h>

#include "source/util/hex_float.h"
#include "unit_spirv.h"

namespace {
using ::testing::Eq;
Expand Down
2 changes: 1 addition & 1 deletion test/ImmediateInt.cpp → test/immediate_int_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <gmock/gmock.h>

#include "TestFixture.h"
#include "test_fixture.h"
#include "source/util/bitutils.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion test/LibspirvMacros.cpp → test/libspirv_macros_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

namespace {

Expand Down
4 changes: 2 additions & 2 deletions test/test_log.cpp → test/log_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ TEST(Log, Unimplemented) {
const spv_position_t&, const char* message) {
++invocation;
EXPECT_EQ(SPV_MSG_INTERNAL_ERROR, level);
EXPECT_THAT(source, MatchesRegex(".*test_log.cpp$"));
EXPECT_THAT(source, MatchesRegex(".*log_test.cpp$"));
EXPECT_STREQ("unimplemented: the-ultimite-feature", message);
};

Expand All @@ -43,7 +43,7 @@ TEST(Log, Unreachable) {
const spv_position_t&, const char* message) {
++invocation;
EXPECT_EQ(SPV_MSG_INTERNAL_ERROR, level);
EXPECT_THAT(source, MatchesRegex(".*test_log.cpp$"));
EXPECT_THAT(source, MatchesRegex(".*log_test.cpp$"));
EXPECT_STREQ("unreachable", message);
};

Expand Down
4 changes: 2 additions & 2 deletions test/NameMapper.cpp → test/name_mapper_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include "gmock/gmock.h"

#include "TestFixture.h"
#include "UnitSPIRV.h"
#include "test_fixture.h"
#include "unit_spirv.h"

#include "source/name_mapper.h"

Expand Down
4 changes: 2 additions & 2 deletions test/NamedId.cpp → test/named_id_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include <vector>

#include "TestFixture.h"
#include "UnitSPIRV.h"
#include "test_fixture.h"
#include "unit_spirv.h"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion test/OpcodeMake.cpp → test/opcode_make_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

namespace {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "UnitSPIRV.h"
#include "unit_spirv.h"

#include "enum_set.h"

Expand Down
Loading

0 comments on commit 4f57e14

Please sign in to comment.