Commit 5c4b7472da2993b8d13d211cf1f1978456985509

Patrick Steinhardt 2018-10-26T13:49:48

tests: simplify cmake test configuration Simplify the names for the tests, removing the unnecessary "libgit2-clar" prefix. Make "all" the new default test run, and include the online tests by default (since HTTPS should always be enabled). For the CI tests, create an offline-only test, then the various online tests. (cherry picked from commit ce798b256b071f57bfd62664626c10339b3e36f7)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 97c19a5..2eca57d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -703,15 +703,12 @@ IF (BUILD_CLAR)
 	ENDIF ()
 
 	ENABLE_TESTING()
-	IF (WINHTTP OR OPENSSL_FOUND OR SECURITY_FOUND)
-		ADD_TEST(libgit2_clar libgit2_clar -ionline -xclone::local::git_style_unc_paths -xclone::local::standard_unc_paths_are_written_git_style)
-	ELSE ()
-		ADD_TEST(libgit2_clar libgit2_clar -v -xclone::local::git_style_unc_paths -xclone::local::standard_unc_paths_are_written_git_style)
-	ENDIF ()
 
-	# Add additional test targets that require special setup
-	ADD_TEST(libgit2_clar-proxy_credentials libgit2_clar -v -sonline::clone::proxy_credentials_in_url -sonline::clone::proxy_credentials_request)
-	ADD_TEST(libgit2_clar-ssh libgit2_clar -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths)
+	ADD_TEST(offline   libgit2_clar -v -xonline)
+	ADD_TEST(online    libgit2_clar -v -sonline)
+	ADD_TEST(gitdaemon libgit2_clar -v -sonline::push)
+	ADD_TEST(ssh       libgit2_clar -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths)
+	ADD_TEST(proxy     libgit2_clar -v -sonline::clone::proxy_credentials_in_url -sonline::clone::proxy_credentials_request)
 ENDIF ()
 
 IF (TAGS)
diff --git a/appveyor.yml b/appveyor.yml
index f76830c..5eac5f1 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -52,9 +52,10 @@ test_script:
     Start-FileDownload https://github.com/ethomson/poxyproxy/releases/download/v0.1.0/poxyproxy-0.1.0.jar -FileName poxyproxy.jar
     # Run this early so we know it's ready by the time we need it
     $proxyJob = Start-Job { java -jar $Env:APPVEYOR_BUILD_FOLDER\build\poxyproxy.jar -d --port 8080 --credentials foo:bar }
-    ctest -V -R libgit2_clar
+    ctest -V -R offline
+    ctest -V -R online
     Receive-Job -Job $proxyJob
     $env:GITTEST_REMOTE_PROXY_URL = "localhost:8080"
     $env:GITTEST_REMOTE_PROXY_USER = "foo"
     $env:GITTEST_REMOTE_PROXY_PASS = "bar"
-    ctest -V -R libgit2_clar-proxy_credentials
+    ctest -V -R proxy
diff --git a/script/citest.sh b/script/citest.sh
index 7e6cdb7..281c01a 100755
--- a/script/citest.sh
+++ b/script/citest.sh
@@ -25,7 +25,9 @@ git daemon --listen=localhost --export-all --enable=receive-pack --base-path="$H
 export GITTEST_REMOTE_URL="git://localhost/test.git"
 
 # Run the test suite
-ctest -V -R libgit2_clar || exit $?
+ctest -V -R offline || exit $?
+ctest -V -R online || exit $?
+ctest -V -R gitdaemon || exit $?
 
 # Now that we've tested the raw git protocol, let's set up ssh to we
 # can do the push tests over it
@@ -71,12 +73,12 @@ 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=""
-ctest -V -R libgit2_clar-ssh || exit $?
+ctest -V -R ssh || exit $?
 
 # Use the proxy we started at the beginning
 export GITTEST_REMOTE_PROXY_URL="localhost:8080"
 export GITTEST_REMOTE_PROXY_USER="foo"
 export GITTEST_REMOTE_PROXY_PASS="bar"
-ctest -V -R libgit2_clar-proxy_credentials || exit $?
+ctest -V -R proxy || exit $?
 
 kill $(cat "$HOME/sshd/pid")