Skip to content

Commit

Permalink
prepare ubuntu24 testbuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
gdraheim committed Feb 28, 2024
1 parent 6045345 commit 67f0929
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 1 deletion.
89 changes: 88 additions & 1 deletion testbuilds.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,53 @@ def test_224_ubuntu22_cmake_build_dockerfile(self) -> None:
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
@unittest.expectedFailure
def test_225_ubuntu24_cmake_build_dockerfile(self) -> None:
# no universe yet (in February 2024)
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/ubuntu24-cm-build.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 600"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} dpkg -S /usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_228_ubuntu16_32bit_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
Expand Down Expand Up @@ -1086,7 +1133,7 @@ def test_323_ubuntu20_cmake_sdl2_dockerfile(self) -> None:
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_324_ubuntu23_cmake_sdl2_dockerfile(self) -> None:
def test_324_ubuntu22_cmake_sdl2_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
Expand Down Expand Up @@ -1126,6 +1173,46 @@ def test_324_ubuntu23_cmake_sdl2_dockerfile(self) -> None:
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_325_ubuntu24_cmake_sdl2_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/ubuntu24-cm-sdl2.dockerfile"
addhosts = self.local_addhosts(dockerfile, "--universe")
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 600"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_335_opensuse15_cmake_sdl2_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
Expand Down
24 changes: 24 additions & 0 deletions testbuilds/ubuntu24-cm-build.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:24.04
ARG no_check=false
ARG no_install=false

RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get install -y gcc zlib1g-dev python3 cmake unzip zip gzip tar pkg-config

RUN mkdir src
COPY CMakeLists.txt README COPYING.LIB ChangeLog src/
COPY CMakeScripts src/CMakeScripts
COPY bins src/bins
COPY docs src/docs
COPY test src/test
COPY SDL src/SDL
COPY zzipwrap src/zzipwrap
COPY zzip src/zzip

RUN mkdir src/build
RUN cd src/build && cmake ..
RUN cd src/build && make
RUN $no_check || (cd src/build && make check)
RUN $no_install || (cd src/build && make install)

25 changes: 25 additions & 0 deletions testbuilds/ubuntu24-cm-sdl2.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu:24.04
ARG no_check=false
ARG no_install=false

RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get install -y gcc zlib1g-dev python3 cmake unzip zip gzip tar pkg-config libsdl2-dev
## libsdl2-dev is on "universe"

RUN mkdir src
COPY CMakeLists.txt README COPYING.LIB ChangeLog src/
COPY CMakeScripts src/CMakeScripts
COPY bins src/bins
COPY docs src/docs
COPY test src/test
COPY SDL src/SDL
COPY zzipwrap src/zzipwrap
COPY zzip src/zzip

RUN mkdir src/build
RUN cd src/build && cmake ..
RUN cd src/build && make
RUN $no_check || (cd src/build && make check)
RUN $no_install || (cd src/build && make install)

0 comments on commit 67f0929

Please sign in to comment.