-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable tests that may fail if the codec is not aom #1176
Merged
wantehchang
merged 4 commits into
AOMediaCodec:main
from
y-guyon:disable_tests_if_not_aom
Oct 19, 2022
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ------------------------------------------------------------------------------ | ||
# | ||
# tests for command lines (lossless) | ||
|
||
# Very verbose but useful for debugging. | ||
set -ex | ||
|
||
if [[ "$#" -ge 1 ]]; then | ||
# eval so that the passed in directory can contain variables. | ||
BINARY_DIR="$(eval echo "$1")" | ||
else | ||
# Assume "tests" is the current directory. | ||
BINARY_DIR="$(pwd)/.." | ||
fi | ||
if [[ "$#" -ge 2 ]]; then | ||
TESTDATA_DIR="$(eval echo "$2")" | ||
else | ||
TESTDATA_DIR="$(pwd)/data" | ||
fi | ||
if [[ "$#" -ge 3 ]]; then | ||
TMP_DIR="$(eval echo "$3")" | ||
else | ||
TMP_DIR="$(mktemp -d)" | ||
fi | ||
|
||
AVIFENC="${BINARY_DIR}/avifenc" | ||
AVIFDEC="${BINARY_DIR}/avifdec" | ||
ARE_IMAGES_EQUAL="${BINARY_DIR}/tests/are_images_equal" | ||
|
||
# Input file paths. | ||
INPUT_Y4M="${TESTDATA_DIR}/kodim03_yuv420_8bpc.y4m" | ||
# Output file names. | ||
ENCODED_FILE="avif_test_cmd_encoded.avif" | ||
DECODED_FILE="avif_test_cmd_decoded.png" | ||
DECODED_FILE_LOSSLESS="avif_test_cmd_decoded_lossless.png" | ||
|
||
# Cleanup | ||
cleanup() { | ||
pushd ${TMP_DIR} | ||
rm -- "${ENCODED_FILE}" "${DECODED_FILE}" "${DECODED_FILE_LOSSLESS}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Just FYI. No change requested.] In these scripts, we should pass |
||
popd | ||
} | ||
trap cleanup EXIT | ||
|
||
pushd ${TMP_DIR} | ||
# Generate test data. | ||
"${AVIFENC}" -s 8 "${INPUT_Y4M}" -o "${ENCODED_FILE}" | ||
"${AVIFDEC}" "${ENCODED_FILE}" "${DECODED_FILE}" | ||
|
||
# Lossless test. The decoded pixels should be the same as the original image. | ||
echo "Testing basic lossless" | ||
# TODO(yguyon): Make this test pass with INPUT_Y4M instead of DECODED_FILE. | ||
y-guyon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"${AVIFENC}" -s 10 -l "${DECODED_FILE}" -o "${ENCODED_FILE}" | ||
"${AVIFDEC}" "${ENCODED_FILE}" "${DECODED_FILE_LOSSLESS}" | ||
"${ARE_IMAGES_EQUAL}" "${DECODED_FILE}" "${DECODED_FILE_LOSSLESS}" 0 | ||
popd | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ------------------------------------------------------------------------------ | ||
# | ||
# tests for command lines (metadata) | ||
|
||
# Very verbose but useful for debugging. | ||
set -ex | ||
|
||
if [[ "$#" -ge 1 ]]; then | ||
# eval so that the passed in directory can contain variables. | ||
BINARY_DIR="$(eval echo "$1")" | ||
else | ||
# Assume "tests" is the current directory. | ||
BINARY_DIR="$(pwd)/.." | ||
fi | ||
if [[ "$#" -ge 2 ]]; then | ||
TESTDATA_DIR="$(eval echo "$2")" | ||
else | ||
TESTDATA_DIR="$(pwd)/data" | ||
fi | ||
if [[ "$#" -ge 3 ]]; then | ||
TMP_DIR="$(eval echo "$3")" | ||
else | ||
TMP_DIR="$(mktemp -d)" | ||
fi | ||
|
||
AVIFENC="${BINARY_DIR}/avifenc" | ||
|
||
# Input file paths. | ||
INPUT_PNG="${TESTDATA_DIR}/paris_icc_exif_xmp.png" | ||
INPUT_JPG="${TESTDATA_DIR}/paris_exif_xmp_icc.jpg" | ||
# Output file names. | ||
ENCODED_FILE="avif_test_cmd_encoded.avif" | ||
ENCODED_FILE_NO_METADATA="avif_test_cmd_encoded_no_metadata.avif" | ||
|
||
# Cleanup | ||
cleanup() { | ||
pushd ${TMP_DIR} | ||
rm -- "${ENCODED_FILE}" "${ENCODED_FILE_NO_METADATA}" | ||
popd | ||
} | ||
trap cleanup EXIT | ||
|
||
pushd ${TMP_DIR} | ||
# Metadata test. | ||
echo "Testing metadata enc" | ||
for INPUT in "${INPUT_PNG}" "${INPUT_JPG}"; do | ||
"${AVIFENC}" "${INPUT}" -o "${ENCODED_FILE}" | ||
# Ignoring a metadata chunk should produce a different output file. | ||
"${AVIFENC}" "${INPUT}" -o "${ENCODED_FILE_NO_METADATA}" --ignore-icc | ||
cmp "${ENCODED_FILE}" "${ENCODED_FILE_NO_METADATA}" && exit 1 | ||
"${AVIFENC}" "${INPUT}" -o "${ENCODED_FILE_NO_METADATA}" --ignore-exif | ||
cmp "${ENCODED_FILE}" "${ENCODED_FILE_NO_METADATA}" && exit 1 | ||
"${AVIFENC}" "${INPUT}" -o "${ENCODED_FILE_NO_METADATA}" --ignore-xmp | ||
cmp "${ENCODED_FILE}" "${ENCODED_FILE_NO_METADATA}" && exit 1 | ||
done | ||
popd | ||
|
||
exit 0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Just a comment, no change requested.] Disabling these tests when libaom is not available is a drastic measure. This is appropriate as a simple solution in the v0.11.1 patch release.