VirtualBox

source: vbox/trunk/src/VBox/VMM/testcase/tstIEMAImplData.sh@ 103025

Last change on this file since 103025 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1#!/usr/bin/env kmk_ash
2# $Id: tstIEMAImplData.sh 98103 2023-01-17 14:15:46Z vboxsync $
3## @file
4# Shell script for massaging a data file to stub missing instructions.
5#
6
7#
8# Copyright (C) 2022-2023 Oracle and/or its affiliates.
9#
10# This file is part of VirtualBox base platform packages, as
11# available from https://www.virtualbox.org.
12#
13# This program is free software; you can redistribute it and/or
14# modify it under the terms of the GNU General Public License
15# as published by the Free Software Foundation, in version 3 of the
16# License.
17#
18# This program is distributed in the hope that it will be useful, but
19# WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21# General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, see <https://www.gnu.org/licenses>.
25#
26# SPDX-License-Identifier: GPL-3.0-only
27#
28
29# Get parameters.
30 CP="$1"
31 MV="$2"
32 SED="$3"
33 APPEND="$4"
34 OUTDIR="$5"
35 SRCDIR="$6"
36 FILE="$7"
37
38# Globals.
39set -e
40LC_ALL=C
41export LC_ALL
42SRCFILE="${SRCDIR}/tstIEMAImplData${FILE}.cpp"
43OUTFILE="${OUTDIR}/tstIEMAImplData${FILE}.cpp"
44
45# Copy the file and deal with empty file.
46if test -f "${SRCFILE}"; then
47 "${CP}" -f -- "${SRCFILE}" "${OUTFILE}.tmp"
48else
49 "${APPEND}" -t "${OUTFILE}.tmp"
50fi
51if ! test -s "${OUTFILE}.tmp"; then
52 echo '#include "tstIEMAImpl.h"' >> "${OUTFILE}.tmp"
53fi
54"${APPEND}" "${OUTFILE}.tmp" ""
55
56# Stub empty test arrays.
57"${SED}" -n -e 's/\r//' \
58 -e 's/TSTIEM_DECLARE_TEST_ARRAY[(]'"${FILE}"', *\([^,]*\), *\([^ ][^ ]*\) *[)];/\1\n\2/p' \
59 "${SRCDIR}/tstIEMAImpl.h" \
60 --output-binary="${OUTFILE}.tmp2"
61
62while IFS= read -r a_Type && IFS= read -r a_Instr;
63do
64 if "${SED}" -n -e "/ const g_cTests_${a_Instr} /q1" "${OUTFILE}.tmp"; then
65 "${APPEND}" "${OUTFILE}.tmp" "TSTIEM_DEFINE_EMPTY_TEST_ARRAY(${a_Type}, ${a_Instr});"
66 fi
67done < "${OUTFILE}.tmp2"
68
69# Put the file into place, removing the tmp2 file in the process (avoid needing RM).
70"${MV}" -f -- "${OUTFILE}.tmp" "${OUTFILE}.tmp2"
71"${MV}" -f -- "${OUTFILE}.tmp2" "${OUTFILE}"
72
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette