mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-01 20:13:01 +00:00

When implementing the ssh testing, the move to the script made it so the first test suite's exit code was ignored. Check whether the main tests fail and exit with an error in that case.
38 lines
1.0 KiB
Bash
Executable File
38 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Create a test repo which we can use for the online::push tests
|
|
mkdir $HOME/_temp
|
|
git init --bare $HOME/_temp/test.git
|
|
git daemon --listen=localhost --export-all --enable=receive-pack --base-path=$HOME/_temp $HOME/_temp 2>/dev/null &
|
|
export GITTEST_REMOTE_URL="git://localhost/test.git"
|
|
|
|
mkdir _build
|
|
cd _build
|
|
cmake .. -DCMAKE_INSTALL_PREFIX=../_install $OPTIONS
|
|
cmake --build . --target install
|
|
ctest -V .
|
|
ecode=$?
|
|
|
|
if [ $ecode -ne 0 ]; then
|
|
exit $ecode
|
|
fi
|
|
|
|
# Now that we've tested the raw git protocol, let's set up ssh to we
|
|
# can do the push tests over it
|
|
|
|
killall git-daemon
|
|
sudo start ssh
|
|
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
|
|
cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
|
|
ssh-keyscan -t rsa localhost >>~/.ssh/known_hosts
|
|
|
|
export GITTEST_REMOTE_URL="ssh://localhost/$HOME/_temp/test.git"
|
|
export GITTEST_REMOTE_USER=$USER
|
|
export GITTEST_REMOTE_SSH_KEY="$HOME/.ssh/id_rsa"
|
|
export GITTEST_REMOTE_SSH_PUBKEY="$HOME/.ssh/id_rsa.pub"
|
|
export GITTEST_REMOTE_SSH_PASSPHRASE=""
|
|
|
|
if [ -e ./libgit2_clar ]; then
|
|
./libgit2_clar -sonline::push
|
|
fi
|