xref: /trunk/test/odf-validate/fixtures/doctypes/run.sh (revision 0e16a31d78a652c56c5c0fc79c752f48b9048df9)
1#!/bin/zsh
2#**************************************************************
3#
4#  Licensed to the Apache Software Foundation (ASF) under one
5#  or more contributor license agreements.  See the NOTICE file
6#  distributed with this work for additional information
7#  regarding copyright ownership.  The ASF licenses this file
8#  to you under the Apache License, Version 2.0 (the
9#  "License"); you may not use this file except in compliance
10#  with the License.  You may obtain a copy of the License at
11#
12#    http://www.apache.org/licenses/LICENSE-2.0
13#
14#  Unless required by applicable law or agreed to in writing,
15#  software distributed under the License is distributed on an
16#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17#  KIND, either express or implied.  See the License for the
18#  specific language governing permissions and limitations
19#  under the License.
20# usage: fixtures/doctypes/run.sh <strict|ext> <port> <outdir>
21# Starts a headless office saving in the given ODF mode (profile created as drive.sh does), runs make.py, stops it.
22source ${0:A:h:h:h}/env.sh
23mode=$1; port=$2; out=$3
24case $mode in ext) v=3;; strict) v=4;; *) echo "run.sh: unknown mode $mode" >&2; exit 2;; esac
25prof=t12_main_$mode
26mkdir -p $D/runs/profile_$prof/user
27cat > $D/runs/profile_$prof/user/registrymodifications.xcu <<XCU
28<?xml version="1.0" encoding="UTF-8"?>
29<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
30<item oor:path="/org.openoffice.Office.Common/Save/ODF"><prop oor:name="DefaultVersion" oor:op="fuse"><value>$v</value></prop></item>
31</oor:items>
32XCU
33$D/start.sh $prof $port || exit 2
34$D/runpy.sh $D/fixtures/doctypes/make.py $port $out
35rc=$?
36pkill -f "profile_$prof"
37exit $rc
38