VirtualBox

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

Last change on this file since 96312 was 94412, checked in by vboxsync, 3 years ago

tstIEMAImpl: Build fixes and AMD data. bugref:9898

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1#!/usr/bin/env kmk_ash
2# $Id: tstIEMAImplData.sh 94412 2022-03-31 11:26:27Z vboxsync $
3## @file
4# Shell script for massaging a data file to stub missing instructions.
5#
6
7#
8# Copyright (C) 2022 Oracle Corporation
9#
10# This file is part of VirtualBox Open Source Edition (OSE), as
11# available from http://www.virtualbox.org. This file is free software;
12# you can redistribute it and/or modify it under the terms of the GNU
13# General Public License (GPL) as published by the Free Software
14# Foundation, in version 2 as it comes in the "COPYING" file of the
15# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17#
18
19# Get parameters.
20 CP="$1"
21 MV="$2"
22 SED="$3"
23 APPEND="$4"
24 OUTDIR="$5"
25 SRCDIR="$6"
26 FILE="$7"
27
28# Globals.
29set -e
30LC_ALL=C
31export LC_ALL
32SRCFILE="${SRCDIR}/tstIEMAImplData${FILE}.cpp"
33OUTFILE="${OUTDIR}/tstIEMAImplData${FILE}.cpp"
34
35# Copy the file and deal with empty file.
36if test -f "${SRCFILE}"; then
37 "${CP}" -f -- "${SRCFILE}" "${OUTFILE}.tmp"
38else
39 "${APPEND}" -t "${OUTFILE}.tmp"
40fi
41if ! test -s "${OUTFILE}.tmp"; then
42 echo '#include "tstIEMAImpl.h"' >> "${OUTFILE}.tmp"
43fi
44"${APPEND}" "${OUTFILE}.tmp" ""
45
46# Stub empty test arrays.
47"${SED}" -n -e 's/\r//' \
48 -e 's/TSTIEM_DECLARE_TEST_ARRAY[(]'"${FILE}"', *\([^,]*\), *\([^ ][^ ]*\) *[)];/\1\n\2/p' \
49 "${SRCDIR}/tstIEMAImpl.h" \
50 --output-binary="${OUTFILE}.tmp2"
51
52while IFS= read -r a_Type && IFS= read -r a_Instr;
53do
54 if "${SED}" -n -e "/ const g_cTests_${a_Instr} /q1" "${OUTFILE}.tmp"; then
55 "${APPEND}" "${OUTFILE}.tmp" "TSTIEM_DEFINE_EMPTY_TEST_ARRAY(${a_Type}, ${a_Instr});"
56 fi
57done < "${OUTFILE}.tmp2"
58
59# Put the file into place, removing the tmp2 file in the process (avoid needing RM).
60"${MV}" -f -- "${OUTFILE}.tmp" "${OUTFILE}.tmp2"
61"${MV}" -f -- "${OUTFILE}.tmp2" "${OUTFILE}"
62
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