Skip to content

Commit f4f82bc

Browse files
authored
Flatten test folder (pytorch#613)
1 parent 0a8df45 commit f4f82bc

11 files changed

+8
-13
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ add_subdirectory(src/torchcodec/_core)
77
option(BUILD_TESTS "Build tests" OFF)
88
if(BUILD_TESTS)
99
enable_testing()
10-
add_subdirectory(test/decoders)
10+
add_subdirectory(test)
1111
endif()

test/decoders/CMakeLists.txt renamed to test/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ add_executable(
2323

2424
target_include_directories(VideoDecoderTest SYSTEM PRIVATE ${TORCH_INCLUDE_DIRS})
2525
target_include_directories(VideoDecoderTest SYSTEM PRIVATE ${libav_include_dirs})
26-
target_include_directories(VideoDecoderTest PRIVATE ../../)
26+
target_include_directories(VideoDecoderTest PRIVATE ../)
2727

2828
target_link_libraries(
2929
VideoDecoderTest

test/decoders/VideoDecoderTest.cpp renamed to test/VideoDecoderTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ std::string getResourcePath(const std::string& filename) {
3434
#else
3535
std::filesystem::path dirPath = std::filesystem::path(__FILE__);
3636
std::string filepath =
37-
dirPath.parent_path().string() + "/../resources/" + filename;
37+
dirPath.parent_path().string() + "/resources/" + filename;
3838
#endif
3939
return filepath;
4040
}

test/decoders/__init__.py

-5
This file was deleted.

test/samplers/__init__.py

Whitespace-only changes.

test/decoders/test_decoders.py renamed to test/test_decoders.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
VideoStreamMetadata,
1919
)
2020

21-
from ..utils import (
21+
from .utils import (
2222
assert_frames_equal,
2323
AV1_VIDEO,
2424
cpu_and_cuda,

test/decoders/test_metadata.py renamed to test/test_metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919
from torchcodec.decoders import AudioDecoder, VideoDecoder
2020

21-
from ..utils import NASA_AUDIO_MP3, NASA_VIDEO
21+
from .utils import NASA_AUDIO_MP3, NASA_VIDEO
2222

2323

2424
# TODO: Expected values in these tests should be based on the assets's

test/decoders/test_ops.py renamed to test/test_ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
seek_to_pts,
4040
)
4141

42-
from ..utils import (
42+
from .utils import (
4343
assert_frames_equal,
4444
cpu_and_cuda,
4545
NASA_AUDIO,
File renamed without changes.

test/samplers/test_samplers.py renamed to test/test_samplers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from torchcodec.samplers._index_based import _build_all_clips_indices
2020
from torchcodec.samplers._time_based import _build_all_clips_timestamps
2121

22-
from ..utils import assert_frames_equal, NASA_VIDEO
22+
from .utils import assert_frames_equal, NASA_VIDEO
2323

2424

2525
def _assert_output_type_and_shapes(

test/samplers/test_video_clip_sampler.py renamed to test/test_video_clip_sampler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
VideoClipSampler,
1111
)
1212

13-
from ..utils import NASA_VIDEO
13+
from .utils import NASA_VIDEO
1414

1515

1616
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)