Skip to content

Commit

Permalink
Updated test-versioning.sh for SDL2 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 1, 2025
1 parent 2046518 commit f4b0be9
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 202 deletions.
68 changes: 53 additions & 15 deletions build-scripts/test-versioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,74 @@ not_ok () {
failed=1
}

major=$(sed -Ene 's/^m4_define\(\[MAJOR_VERSION_MACRO\], \[([0-9]*)\]\)$/\1/p' configure.ac)
minor=$(sed -Ene 's/^m4_define\(\[MINOR_VERSION_MACRO\], \[([0-9]*)\]\)$/\1/p' configure.ac)
micro=$(sed -Ene 's/^m4_define\(\[MICRO_VERSION_MACRO\], \[([0-9]*)\]\)$/\1/p' configure.ac)
version="${major}.${minor}.${micro}"

if [ "$ref_version" = "$version" ]; then
ok "configure.ac $version"
else
not_ok "configure.ac $version disagrees with $header $ref_version"
fi

major=$(sed -ne 's/^MAJOR_VERSION=//p' configure)
minor=$(sed -ne 's/^MINOR_VERSION=//p' configure)
micro=$(sed -ne 's/^MICRO_VERSION=//p' configure)
version="${major}.${minor}.${micro}"

if [ "$ref_version" = "$version" ]; then
ok "configure $version"
else
not_ok "configure $version disagrees with $header $ref_version"
fi

major=$(sed -ne 's/^set(MAJOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
minor=$(sed -ne 's/^set(MINOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
micro=$(sed -ne 's/^set(MICRO_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
ref_sdl_req=$(sed -ne 's/^set(SDL_REQUIRED_VERSION \([0-9.]*\))$/\1/p' CMakeLists.txt)
sdl_req=$(sed -ne 's/^set(SDL_REQUIRED_VERSION \([0-9.]*\))$/\1/p' CMakeLists.txt)
version="${major}.${minor}.${micro}"

if [ "$ref_version" = "$version" ]; then
ok "CMakeLists.txt $version"
else
not_ok "CMakeLists.txt $version disagrees with SDL_mixer.h $ref_version"
not_ok "CMakeLists.txt $version disagrees with $header $ref_version"
fi

if [ "$ref_sdl_req" = "$sdl_req" ]; then
ok "CMakeLists.txt $sdl_req"
else
not_ok "CMakeLists.txt SDL_REQUIRED_VERSION=$sdl_req disagrees with configure.ac SDL_VERSION=$ref_sdl_req"
fi

for rcfile in version.rc; do
major=$(sed -ne 's/^MAJOR_VERSION *= *//p' Makefile.os2)
minor=$(sed -ne 's/^MINOR_VERSION *= *//p' Makefile.os2)
micro=$(sed -ne 's/^MICRO_VERSION *= *//p' Makefile.os2)
version="${major}.${minor}.${micro}"

if [ "$ref_version" = "$version" ]; then
ok "Makefile.os2 $version"
else
not_ok "Makefile.os2 $version disagrees with $header $ref_version"
fi

for rcfile in version.rc VisualC/Version.rc; do
tuple=$(sed -ne 's/^ *FILEVERSION *//p' "$rcfile" | tr -d '\r')
ref_tuple="${ref_major},${ref_minor},${ref_micro},0"

if [ "$ref_tuple" = "$tuple" ]; then
ok "$rcfile FILEVERSION $tuple"
else
not_ok "$rcfile FILEVERSION $tuple disagrees with SDL_mixer.h $ref_tuple"
not_ok "$rcfile FILEVERSION $tuple disagrees with $header $ref_tuple"
fi

tuple=$(sed -ne 's/^ *PRODUCTVERSION *//p' "$rcfile" | tr -d '\r')

if [ "$ref_tuple" = "$tuple" ]; then
ok "$rcfile PRODUCTVERSION $tuple"
else
not_ok "$rcfile PRODUCTVERSION $tuple disagrees with SDL_mixer.h $ref_tuple"
not_ok "$rcfile PRODUCTVERSION $tuple disagrees with $header $ref_tuple"
fi

tuple=$(sed -Ene 's/^ *VALUE "FileVersion", "([0-9, ]*)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r')
Expand All @@ -65,15 +105,15 @@ for rcfile in version.rc; do
if [ "$ref_tuple" = "$tuple" ]; then
ok "$rcfile FileVersion $tuple"
else
not_ok "$rcfile FileVersion $tuple disagrees with SDL_mixer.h $ref_tuple"
not_ok "$rcfile FileVersion $tuple disagrees with $header $ref_tuple"
fi

tuple=$(sed -Ene 's/^ *VALUE "ProductVersion", "([0-9, ]*)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r')

if [ "$ref_tuple" = "$tuple" ]; then
ok "$rcfile ProductVersion $tuple"
else
not_ok "$rcfile ProductVersion $tuple disagrees with SDL_mixer.h $ref_tuple"
not_ok "$rcfile ProductVersion $tuple disagrees with $header $ref_tuple"
fi
done

Expand All @@ -82,15 +122,15 @@ version=$(sed -Ene '/CFBundleShortVersionString/,+1 s/.*<string>(.*)<\/string>.*
if [ "$ref_version" = "$version" ]; then
ok "Info-Framework.plist CFBundleShortVersionString $version"
else
not_ok "Info-Framework.plist CFBundleShortVersionString $version disagrees with SDL_mixer.h $ref_version"
not_ok "Info-Framework.plist CFBundleShortVersionString $version disagrees with $header $ref_version"
fi

version=$(sed -Ene '/CFBundleVersion/,+1 s/.*<string>(.*)<\/string>.*/\1/p' Xcode/Info-Framework.plist)

if [ "$ref_version" = "$version" ]; then
ok "Info-Framework.plist CFBundleVersion $version"
else
not_ok "Info-Framework.plist CFBundleVersion $version disagrees with SDL_mixer.h $ref_version"
not_ok "Info-Framework.plist CFBundleVersion $version disagrees with $header $ref_version"
fi

# For simplicity this assumes we'll never break ABI before SDL 3.
Expand Down Expand Up @@ -138,14 +178,12 @@ else
not_ok "project.pbxproj DYLIB_CURRENT_VERSION is inconsistent, expected $ref, got $dylib_cur"
fi

if [ -f ".github/fetch_sdl_vc.ps1" ]; then
sdl_req=$(sed -ne 's/\$sdl2_version = "\([0-9.]*\)"$/\1/p' .github/fetch_sdl_vc.ps1)
sdl_req=$(sed -ne 's/\$sdl2_version = "\([0-9.]*\)"$/\1/p' .github/fetch_sdl_vc.ps1)

if [ "$ref_sdl_req" = "$sdl_req" ]; then
ok ".github/fetch_sdl_vc.ps1 $sdl_req"
else
not_ok ".github/fetch_sdl_vc.ps1 sdl2_version=$sdl_req disagrees with CMakeLists.txt SDL_REQUIRED_VERSION=$ref_sdl_req"
fi
if [ "$ref_sdl_req" = "$sdl_req" ]; then
ok ".github/fetch_sdl_vc.ps1 $sdl_req"
else
not_ok ".github/fetch_sdl_vc.ps1 sdl2_version=$sdl_req disagrees with configure.ac SDL_VERSION=$ref_sdl_req"
fi

echo "1..$tests"
Expand Down
187 changes: 0 additions & 187 deletions test-versioning.sh

This file was deleted.

0 comments on commit f4b0be9

Please sign in to comment.