File: 09-allow-tests-to-be-skipped.patch

package info (click to toggle)
vim-youcompleteme 0%2B20240827%2Bgitb6e8c64%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,436 kB
  • sloc: python: 10,914; sh: 204; cpp: 141; makefile: 26; f90: 5; xml: 1
file content (41 lines) | stat: -rw-r--r-- 1,076 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Description: Implement a simple interface to skip vim tests
 In this way I can skip certain tests in autopkgtest to run them
 later on individually if desired.
 .
 The patch is incomplete as it does handle only skipping entire
 tests while upstream allows running individual testcases inside
 a test file, so an upstreamable --skip should ideally support
 this as well beside that the patch as-is depends on the retry
 one at the moment althrough trivially.
Author: David Kalnischkies <donkult@debian.org>
Forwarded: no

--- a/test/run_vim_tests
+++ b/test/run_vim_tests
@@ -11,12 +11,14 @@
 
 VIM=vim
 RETRY=0
+SKIP=','
 
 while [ -n "$1" ]; do
   case "$1" in
   '--stdout') export YCM_TEST_STDOUT=1;;
   '--vim') VIM="$2"; shift;;
   '--retry') RETRY=$2; shift;;
+  '--skip') SKIP="${SKIP}${2},"; shift;;
   *) break;;
   esac
   shift
@@ -42,6 +44,11 @@
   echo ""
   echo "%RUN: $t"
 
+  if [ "${SKIP#*${t}}" != "$SKIP" ]; then
+    echo '%SKIP: Requested via command line'
+    continue
+  fi
+
   # split on : into fileName and testName
   IFS=: read -s t T <<< "$t"