README.md
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"); you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18-->
19
20# tools13: foreign ODF 1.2 / 1.3 corpus
21
22`make-foreign-corpus.py` converts the same input documents with another popular Open Source Office suite
23(headless) once per output version, giving ODF 1.2 / 1.3 twins for an import smoke test.
24
25## Version values (observed)
26
27The output version comes from the profile setting `/org.openoffice.Office.Common/Save/ODF`, property
28`DefaultVersion`, written to the private profile's `user/registrymodifications.xcu`. Found black-box by converting one
29small document per value (`--probe`) and reading `office:version` / `manifest:version` and the declared namespaces back
30from the result. "Ext" means loext, calcext, officeooo, drawooo, tableooo and the ooo-ms-interop `field` namespace are
31declared.
32
33| value | office:version | extension namespaces |
34|---|---|---|
35| 1 | none (ODF 1.0) | no |
36| 2 | 1.1 (manifest has no version) | no |
37| 4 | 1.2 | no |
38| 8, 9 | 1.2 | yes |
39| 10 | 1.3 | no |
40| 11 | 1.3 | yes |
41| 12 | 1.4 | no |
42| 13 | 1.4 | yes |
43| 0, 3, 5, 6, 7, 14-20 | 1.4 | yes (acts as the default) |
44
45Modes used: `v12` = 4, `v12ext` = 8, `v13` = 10, `v13ext` = 11. Observed on one build (26.8.1.1); re-run `--probe`
46for another one. Plain-mode outputs still carry the legacy `ooo`, `oooc`, `ooow`, `rpt`, `formx` namespaces.
47
48## Run
49
50 python3 -I make-foreign-corpus.py <path to the other suite's soffice binary>
51
52Defaults: 55 documents chosen from `runs/gate-t16f/jobs.tsv` (see the comment above `QUOTA` in the script;
53`--list-selection` prints them), output root `test/odf-validate/runs/phase3/foreign/`. Other options: `--inputs LIST`
54(one path per line, first tab column used), `--root`, `--modes`, `--batch`, `--timeout`,
55`--probe WORKDIR [--probe-range 0-20]` for the value table only.
56
57Outputs: `<root>/<mode>/<name>.<odt|ods|odp|odg>` (legacy inputs map to their ODF type, e.g. `x.doc` -> `x.odt`; two
58inputs that would give the same output name are refused), `<root>/manifest.tsv` (input, mode, output, office:version,
59manifest:version, ok/fail, note), `<root>/logs/`, and one private profile per mode (`<root>/foreign-prof-<mode>`).
60Every output is checked for the expected `office:version` (in content, styles, meta, settings) and
61`manifest:version`; plain modes must declare no extension namespaces, ext modes must. Any mismatch or missing
62output gives a non-zero exit. Timed-out batches are retried file by file.
63
64Process safety: only processes whose command line carries one of its own profile URLs are ever killed, and the
65script refuses to start if such a process already exists.
66
67## Use
68
69A later import smoke test loads `<root>/v13/X` and `<root>/v12/X` (and the `ext` pair) and compares what the importer
70produced from each, so a 1.3-specific import difference shows up against the 1.2 twin of the same source.
71
72## Clean-room note
73
74Only the other suite's output files and its public behaviour are observed. Its source code and its installed
75resource/configuration files are not read, and its name is not used in files here; the binary path is a command
76line argument only.
77