Skip to content

Commit 5554c57

Browse files
committed
Merge branch 'mr/pmderodat/U204-026-arch-mix' into 'master'
U204-026-arch-mix: various update scripts fixes/enhancements See merge request eng/das/cov/gnatcoverage!840 In the course of https://gitlab.adacore-it.com/eng/das/cov/gnatcoverage/-/issues/258
2 parents 2996359 + e521d91 commit 5554c57

File tree

3 files changed

+43
-21
lines changed

3 files changed

+43
-21
lines changed

testsuite/tests/U204-026-arch-mix/update.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,28 @@ fi
1212

1313
# Update the linux artifacts
1414
cd ..
15-
cp -rf U204-026-arch-mix /tmp/
15+
rsync -ar U204-026-arch-mix/ /tmp/U204-026-arch-mix
1616
cd /tmp/U204-026-arch-mix
1717
./gen.sh linux
1818
cd $cwd
19-
cp -rf /tmp/U204-026-arch-mix/* .
19+
rsync -ar /tmp/U204-026-arch-mix/ .
2020

21-
# Then update the windows artifacts
22-
[ ! -d '/tmp/iod-dev' ] && git clone git-adacore:eng/shared/iod-dev /tmp/iod-dev
23-
/tmp/iod-dev/create-base.py --base-image x86_64-windows-2019
24-
git_branch=$(git rev-parse --abbrev-ref HEAD)
25-
sshpass ssh iod 'bash -s' < update_arch_mix_windows.sh $git_branch
21+
# Then update the Windows artifacts using an IOD machine. Do not create the IOD
22+
# instance if one already exists
23+
IOD_DEV_DIR=/tmp/iod-dev
24+
INSTANCES_FILE="$IOD_DEV_DIR/instances.txt"
25+
if ! [ -d "$IOD_DEV_DIR" ]
26+
then
27+
git clone git-adacore:eng/shared/iod-dev "$IOD_DEV_DIR"
28+
fi
29+
iod list --instances > "$INSTANCES_FILE" 2>&1
30+
if ! grep "You have some running instance" "$INSTANCES_FILE" \
31+
> /dev/null
32+
then
33+
"$IOD_DEV_DIR/create-base.py" --base-image x86_64-windows-2019
34+
fi
35+
36+
ssh iod 'bash -s' < update_win_setup_git.sh
37+
git push -f iod:gnatcoverage HEAD:wip
38+
ssh iod 'bash -s' < update_arch_mix_windows.sh
2639
rsync -av iod:/cygdrive/c/tmp/U204-026-arch-mix/gen/* gen/

testsuite/tests/U204-026-arch-mix/update_arch_mix_windows.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22

33
set -ex
44

5-
if [ $# -eq 0 ]; then
6-
echo "No arguments provided. Please provide the name of the gnatcov branch"
7-
exit 1
8-
fi
9-
105
# Create a sandbox
116
cd /Users/itmgr
12-
git clone git-adacore:eng/cov/gnatcoverage
13-
anod init wave
7+
if ! [ -d wave ]
8+
then
9+
anod init wave
10+
fi
1411

1512
# Checkout the right gnatcov branch
1613
cd /Users/itmgr/gnatcoverage
17-
git fetch origin
18-
git checkout origin/$1
14+
git reset --hard wip
1915

2016
# Build gnatcov
2117
cd /Users/itmgr/wave
18+
anod vcs --reset
2219
anod vcs --add-repo gnatcoverage /Users/itmgr/gnatcoverage
23-
anod build gnatcov --interactive never
20+
anod build gnatcov --smart
21+
anod install gnatall -Qstable
2422
eval $(anod printenv gnatcov)
2523
eval $(anod printenv gnatall -Qstable)
2624

2725
# Then, retrieve the sources of the arch-mix test
28-
rm -rf /Users/itmgr/gnatcoverage/testsuite/tests/U204-026-arch-mix/gen/x86_64-windows
29-
cp -r /Users/itmgr/gnatcoverage/testsuite/tests/U204-026-arch-mix /cygdrive/c/tmp
30-
cd /cygdrive/c/tmp/U204-026-arch-mix
26+
SRC_DIR=/Users/itmgr/gnatcoverage/testsuite/tests/U204-026-arch-mix
27+
BUILD_DIR=/cygdrive/c/tmp/U204-026-arch-mix
28+
rm -rf "$SRC_DIR/gen/x86_64-windows"
29+
rsync -ar "$SRC_DIR/" "$BUILD_DIR"
30+
cd "$BUILD_DIR"
3131
chmod +x gen.sh
3232
gnatcov setup
3333
./gen.sh windows
3434

3535
# Copy back the generated sources
36-
cp -r /cygdrive/c/tmp/U204-026-arch-mix/gen/* /Users/itmgr/gnatcoverage/testsuite/tests/U204-026-arch-mix/gen/
36+
rsync -ar "$BUILD_DIR/gen/" "$SRC_DIR/gen"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Set up the gnatcoverage repositoy on the Windows IOD machie
2+
3+
set -ex
4+
5+
cd /Users/itmgr
6+
if ! [ -d gnatcoverage ]
7+
then
8+
git clone git-adacore:eng/cov/gnatcoverage
9+
fi

0 commit comments

Comments
 (0)