Skip to content

Commit

Permalink
Moved testing gif file to test/data submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
Mi-La committed Sep 1, 2023
1 parent 20377fa commit adf6076
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
7 changes: 6 additions & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ compare_test_data()
local MSYS_WORKAROUND_TEMP=("${!1}"); shift
local TEST_SUITES=("${MSYS_WORKAROUND_TEMP[@]}")

echo
echo "Comparing data created by tests"

local TOTAL_BLOBS=0
Expand Down Expand Up @@ -110,7 +111,11 @@ compare_test_data()
TOTAL_JSONS=$((TOTAL_JSONS+NUM_JSONS))
done

echo "Successfully compared ${TOTAL_BLOBS} BLOBs and ${TOTAL_JSONS} JSONs."
if [[ $((TOTAL_BLOBS+TOTAL_JSONS)) -gt 0 ]] ; then
echo "Successfully compared ${TOTAL_BLOBS} BLOBs and ${TOTAL_JSONS} JSONs."
else
echo "Nothing to compare."
fi
echo
}

Expand Down
2 changes: 1 addition & 1 deletion test/data
Submodule data updated 2 files
+2 −2 README.md
+ others/gif/1pix.gif
4 changes: 2 additions & 2 deletions test/others/gif/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ zserio_add_library(gif_zs
)

add_custom_command(OUTPUT gif_data_copy
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/data/others/gif
${CMAKE_CURRENT_BINARY_DIR}/data
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data
DEPENDS ${CMAKE_SOURCE_DIR}/data/others/gif
COMMENT "Copying data directory for gif test")
add_custom_target(gif_data_copy_target DEPENDS gif_data_copy)
add_dependencies(gif_zs gif_data_copy_target)
Expand Down
2 changes: 1 addition & 1 deletion test/others/gif/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<testRun testName="gif">
<resources>
<copy todir="${gif.run_dir}/data">
<fileset dir="${gif.base_dir}/data"/>
<fileset dir="${zserio_java_test.base_dir}/data/others/gif"/>
</copy>
</resources>
</testRun>
Expand Down
Binary file removed test/others/gif/data/1pix.gif
Binary file not shown.
3 changes: 2 additions & 1 deletion test/others/gif/python/GifTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def testOnePixGif(self):
self.assertEqual(self.GIF_SCREEN_BITS_OF_COLOR_RESOLUTION, screenDescriptor.bits_of_color_resolution)
self.assertEqual(self.GIF_SCREEN_BITS_PER_PIXEL, screenDescriptor.bits_per_pixel)

ONE_PIX_GIF_FILE_NAME = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "data", "1pix.gif")
ONE_PIX_GIF_FILE_NAME = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "..", "data", "others", "gif", "1pix.gif")

GIF_FILE_FORMAT = "GIF"
GIF_FILE_VERSION = "89a"
Expand Down

0 comments on commit adf6076

Please sign in to comment.