Add testing docker build files and usage

This commit is contained in:
Lorenzooone 2021-12-28 02:04:40 +01:00
parent 737fb02e64
commit 71b13445b6
4 changed files with 56 additions and 5 deletions

View File

@ -29,7 +29,9 @@ This project aims to both complete the VWF codebase and to provide a tool for tr
## Screenshots
![](./screenshots/itshappening2.png) ![](./screenshots/itshappening4.png) ![](./screenshots/itshappening5.png) ![](./screenshots/m2-status2.png) ![](./screenshots/m2-battle-slugs.png) ![](./screenshots/m2-fileselect.png)
# Building with Docker
# Building
## Building with Docker
Docker allows easily building without having to install the dependencies.
1. Put a MOTHER 1+2 ROM in `bin/m12fresh.gba`
@ -37,9 +39,9 @@ Docker allows easily building without having to install the dependencies.
The output will be inside the newly created `out` folder.
# Manually Building
## Manually Building
## Dependencies
### Dependencies
- [.NET Core 2.1 or later](https://dotnet.microsoft.com/download)
- [PowerShell Core 6.0 or later](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-6)
- [GNU Arm Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)
@ -68,9 +70,17 @@ The output will be inside the newly created `out` folder.
2. `dotnet build tools/ScriptToolGui -o bin/ScriptToolGui`
3. Run with `dotnet bin/ScriptToolGui/ScriptToolGui.dll` (or just run the EXE file directly).
# Manually Testing
# Testing
## Dependencies
## Testing with Docker
Docker allows easily building without having to install the dependencies.
1. Put a MOTHER 1+2 ROM in `bin/m12fresh.gba`
2. While in the root of the project, run: `docker run --rm -it -v $PWD:/home/m2gba/src lorenzooone/m2gba_translation:tester`
## Manually Testing
### Dependencies
- [mGBA 0.9.3 or later, or nightly built after Nov 29, 2021](https://mgba.io/downloads.html)
- [Building dependencies](#Building)

View File

@ -0,0 +1,15 @@
FROM lorenzooone/m2gba_translation:builder
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential ccache cmake \
git libavcodec-dev libavfilter-dev libavformat-dev libavresample-dev \
libavutil-dev libcmocka-dev libedit-dev libelf-dev libpng-dev \
libqt5opengl5-dev libsdl2-dev libsqlite3-dev libswscale-dev \
libzip-dev qtmultimedia5-dev qttools5-dev qttools5-dev-tools xvfb pulseaudio alsa-utils && \
apt-get autoremove -y && apt-get clean
WORKDIR /home/m2gba
USER m2gba
RUN git clone https://github.com/mgba-emu/mgba.git
RUN cd mgba && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make && cp sdl/mgba /opt/src/bin/mgba-sdl
WORKDIR /opt/src
CMD /home/m2gba/src/docker-scripts/docker-test-rom-script

View File

@ -0,0 +1,3 @@
#!/bin/bash
docker rm image mother2gba:test
docker build . -t mother2gba:test

View File

@ -0,0 +1,23 @@
#!/bin/pwsh
"Starting Dummy services"
Xvfb :1 -screen 0 1024x768x16 &
$Env:DISPLAY = ":1.0"
pulseaudio -D --exit-idle-time=-1
pactl load-module module-null-sink sink_name=SpeakerOutput sink_properties=device.description="Dummy_Output"
$Env:PATH += ":/home/m2gba/.dotnet:/home/m2gba/.dotnet/tools"
Copy-Item -Path "\home\m2gba\src\*" -Destination "\opt\src" -Recurse -Force
"Starting to build tools"
./build-tools.ps1
"Starting to build test rom"
./test.ps1
"Copying test log to output"
New-Item -Path "\home\m2gba\src" -Name "out" -ItemType "directory" -Force
Copy-Item -Path ".\bin\test.log" "\home\m2gba\src\out"
Copy-Item -Path ".\bin\m12test.gba" "\home\m2gba\src\out"
"Test ran successfully, please review the ./out folder for the resulting logs and test rom"