diff --git a/CMakeLists.txt b/CMakeLists.txt index 8757d7f9..0f2d0de2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,5 +7,5 @@ add_subdirectory(src/torchcodec/_core) option(BUILD_TESTS "Build tests" OFF) if(BUILD_TESTS) enable_testing() - add_subdirectory(test/decoders) + add_subdirectory(test) endif() diff --git a/test/decoders/CMakeLists.txt b/test/CMakeLists.txt similarity index 93% rename from test/decoders/CMakeLists.txt rename to test/CMakeLists.txt index 126dd279..988def93 100644 --- a/test/decoders/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -23,7 +23,7 @@ add_executable( target_include_directories(VideoDecoderTest SYSTEM PRIVATE ${TORCH_INCLUDE_DIRS}) target_include_directories(VideoDecoderTest SYSTEM PRIVATE ${libav_include_dirs}) -target_include_directories(VideoDecoderTest PRIVATE ../../) +target_include_directories(VideoDecoderTest PRIVATE ../) target_link_libraries( VideoDecoderTest diff --git a/test/decoders/VideoDecoderTest.cpp b/test/VideoDecoderTest.cpp similarity index 99% rename from test/decoders/VideoDecoderTest.cpp rename to test/VideoDecoderTest.cpp index 7a81e9dd..a7ad4c6d 100644 --- a/test/decoders/VideoDecoderTest.cpp +++ b/test/VideoDecoderTest.cpp @@ -34,7 +34,7 @@ std::string getResourcePath(const std::string& filename) { #else std::filesystem::path dirPath = std::filesystem::path(__FILE__); std::string filepath = - dirPath.parent_path().string() + "/../resources/" + filename; + dirPath.parent_path().string() + "/resources/" + filename; #endif return filepath; } diff --git a/test/decoders/__init__.py b/test/decoders/__init__.py deleted file mode 100644 index 2e41cd71..00000000 --- a/test/decoders/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. diff --git a/test/samplers/__init__.py b/test/samplers/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/test/decoders/test_decoders.py b/test/test_decoders.py similarity index 99% rename from test/decoders/test_decoders.py rename to test/test_decoders.py index 45a71d94..e11981e9 100644 --- a/test/decoders/test_decoders.py +++ b/test/test_decoders.py @@ -18,7 +18,7 @@ VideoStreamMetadata, ) -from ..utils import ( +from .utils import ( assert_frames_equal, AV1_VIDEO, cpu_and_cuda, diff --git a/test/decoders/test_metadata.py b/test/test_metadata.py similarity index 99% rename from test/decoders/test_metadata.py rename to test/test_metadata.py index 6e401879..7ed9508f 100644 --- a/test/decoders/test_metadata.py +++ b/test/test_metadata.py @@ -18,7 +18,7 @@ ) from torchcodec.decoders import AudioDecoder, VideoDecoder -from ..utils import NASA_AUDIO_MP3, NASA_VIDEO +from .utils import NASA_AUDIO_MP3, NASA_VIDEO # TODO: Expected values in these tests should be based on the assets's diff --git a/test/decoders/test_ops.py b/test/test_ops.py similarity index 99% rename from test/decoders/test_ops.py rename to test/test_ops.py index 551b1a51..340b58bb 100644 --- a/test/decoders/test_ops.py +++ b/test/test_ops.py @@ -39,7 +39,7 @@ seek_to_pts, ) -from ..utils import ( +from .utils import ( assert_frames_equal, cpu_and_cuda, NASA_AUDIO, diff --git a/test/samplers/test_policy.py b/test/test_policy.py similarity index 100% rename from test/samplers/test_policy.py rename to test/test_policy.py diff --git a/test/samplers/test_samplers.py b/test/test_samplers.py similarity index 99% rename from test/samplers/test_samplers.py rename to test/test_samplers.py index 7cd0a2da..72ee108e 100644 --- a/test/samplers/test_samplers.py +++ b/test/test_samplers.py @@ -19,7 +19,7 @@ from torchcodec.samplers._index_based import _build_all_clips_indices from torchcodec.samplers._time_based import _build_all_clips_timestamps -from ..utils import assert_frames_equal, NASA_VIDEO +from .utils import assert_frames_equal, NASA_VIDEO def _assert_output_type_and_shapes( diff --git a/test/samplers/test_video_clip_sampler.py b/test/test_video_clip_sampler.py similarity index 98% rename from test/samplers/test_video_clip_sampler.py rename to test/test_video_clip_sampler.py index 01cd55f1..6519ff63 100644 --- a/test/samplers/test_video_clip_sampler.py +++ b/test/test_video_clip_sampler.py @@ -10,7 +10,7 @@ VideoClipSampler, ) -from ..utils import NASA_VIDEO +from .utils import NASA_VIDEO @pytest.mark.parametrize(