Skip to content

Commit 7c062ef

Browse files
committed
Script to download all GMEs
and a bit more files for the test suite
1 parent 8e49687 commit 7c062ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3573
-52
lines changed

default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ in rec {
193193
gme-downloads = pkgs.runCommandNoCC "gme-downloads" {
194194
buildInputs = with pkgs; [ wget ];
195195
outputHashMode = "recursive";
196-
outputHash = "sha256:01byby8fmqmxfg5cb5ss0pmhvf2av65sil9cqbjswky0a1mn7kp5";
196+
outputHash = "sha256:02cayz36ajaw8lv2kri54vmd6qid5w4vn4s6dmagq583f887b03l";
197197
} ''
198198
mkdir -p $out
199-
bash ${./testsuite/download.sh} $out
199+
bash ${./testsuite/download.sh} ${./testsuite/gme-files-test.txt} $out
200200
'';
201201

202202
tests = pkgs.stdenv.mkDerivation {

testsuite/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
output
22
./downloaded
3+
./all-gmes
34
!expected/**
5+

testsuite/README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
A small test suite for tttool
2+
-----------------------------
23

3-
The script `download.sh` downloads a few GME files into the directory
4-
`downloaded/`
4+
The script `download.sh` downloads a those GME files listed in
5+
`gme-files-test.txt` into the directory `downloaded/`. This is a subset of
6+
Ravensburger GMEs, useful for testing.
7+
8+
Feel free to propose a different set of GME files to include in the test
59

610
The script `test.sh` runs a bunch of `tttool` commands on the files in `input/`
711
and `downloaded/`, putting the result in `output/`
@@ -24,3 +28,15 @@ To run the test suite with nix, run
2428
If the downloaded files changed, change the `outputHash` in
2529
`../default.nix` a bit, run the above, and then copy the new hash from the
2630
error message into the `.nix` file.
31+
32+
33+
Getting more GMEs
34+
-----------------
35+
36+
To test theories or search for certain things, it might be useful to fetch all
37+
GMEs. For that, run
38+
39+
./list-gmes.sh
40+
./download.sh gme-files-all.txt all-gmes
41+
42+
Warning, this downloads ~6GB.

testsuite/download.sh

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
#!/usr/bin/env bash
22

33
set -e
4-
dir="${1:-downloaded}"
4+
gmes="${1:-gme-files-test.txt}"
5+
dir="${2:-downloaded}"
56

67
mkdir -p "$dir"
7-
cd "$dir"
8-
9-
# We used to have a script that would fetch an .xml file from ravensburger
10-
# that lists all GME files, but that XML file disappeared.
11-
# For now, just list some GME files
12-
13-
function get() {
14-
wget --no-verbose --timestamping --no-check-certificate \
15-
https://ssl-static.ravensburger.de/db/applications/"$1"
16-
}
17-
18-
get WissenQuizzen1.gme
19-
get Pocketwissen_Feuerwehr.gme
8+
while read -r filename; do
9+
wget --no-verbose --timestamping --no-check-certificate -P "$dir" \
10+
https://ssl-static.ravensburger.de/db/applications/"$filename"
11+
done < "$gmes"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Product ID: 100
2+
Raw XOR value: 0x000000C6
3+
Magic XOR value: 0x55
4+
Comment: CHOMPTECH DATA FORMAT CopyRight 2009 Ver2.10.0901
5+
Date: 20170315
6+
Language:
7+
Number of registers: 3
8+
Initial registers: [0,0,0]
9+
Initial sounds: [[18,25]]
10+
Scripts for OIDs from 4201 to 4282; 0/82 are disabled.
11+
Audio table entries: 1086
12+
Binary tables entries: 0/0/0
13+
Single binary table entries: 1/1/1
14+
Special OIDs: 4210, 0
15+
Checksum found 0x6E379441, calculated 0x6E379441

testsuite/expected/downloaded/Alle meine Tiere.gme.lint.txt

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0fd54c3bbb1a88b494972a2547b08f9f output/downloaded/Alle meine Tiere.gme.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Product ID: 61
2+
Raw XOR value: 0x000000FA
3+
Magic XOR value: 0x16
4+
Comment: CHOMPTECH DATA FORMAT CopyRight 2009 Ver2.10.0901
5+
Date: 20141021
6+
Language:
7+
Number of registers: 71
8+
Initial registers: [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
9+
Initial sounds: [[1447,317],[317]]
10+
Scripts for OIDs from 5670 to 9969; 3709/4300 are disabled.
11+
Audio table entries: 1448
12+
Audio table repeated twice
13+
Binary tables entries: 1/1/1
14+
Single binary table entries: 1/1/1
15+
Special OIDs: 9756, 0
16+
Checksum found 0x0092FB3D, calculated 0x0092FB3D
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e2f933effc132ed235888e4f0bf22e8f output/downloaded/Dein Koerper und Du.gme.yaml

0 commit comments

Comments
 (0)