Browse Source

meilleurs tests

David Sniperovitch 8 years ago
parent
commit
5cb0165217
5 changed files with 153 additions and 0 deletions
  1. 27 0
      t/01_1c_1d_1p_pub_export
  2. 27 0
      t/02_1c_1d_1p_pub
  3. 33 0
      t/05_1c_1d_1p_priv_export
  4. 33 0
      t/06_1c_1d_1p_priv
  5. 33 0
      t/alltests

+ 27 - 0
t/01_1c_1d_1p_pub_export

@@ -0,0 +1,27 @@
+#!/bin/bash
+
+printf "$PRINTFPATTERN" $0 : "1 Compilation. 1 Dossier. 1 Projet. Pad Public. export/txt"
+
+URL_BASE=https%3A%2F%2Fpad.exegetes.eu.org%2Fp%2Fg.DSXI1kGFT1gjor66%24Abro-REP-Tele2-Principal%2Fexport%2Ftxt
+URL_GARDE=https%3A%2F%2Fpad.exegetes.eu.org%2Fp%2Fg.DSXI1kGFT1gjor66%24Abro-REP-Tele2-Garde%2Fexport%2Ftxt
+DOSSIER=MonDossier$$
+PROJET=Abro2$$
+
+OUTPUT=$(./cocktail -v \
+           -d "$DOSSIER" \
+           -p "$PROJET" \
+           -b "$URL_BASE" \
+           -g "$URL_GARDE" 2>&1 >/dev/null) 
+RC=$?
+echo -n "RC=$RC "
+if test "$RC" -ne "0";
+then
+  # Test raté
+  echo "[FAILED]"
+else
+  echo "[  OK  ]"
+fi
+echo "$OUTPUT"
+
+exit "$RC"
+

+ 27 - 0
t/02_1c_1d_1p_pub

@@ -0,0 +1,27 @@
+#!/bin/bash
+
+printf "$PRINTFPATTERN" $0 : "1 Compilation. 1 Dossier. 1 Projet. Pad Public."
+
+URL_BASE=https%3A%2F%2Fpad.exegetes.eu.org%2Fp%2Fg.DSXI1kGFT1gjor66%24Abro-REP-Tele2-Principal
+URL_GARDE=https%3A%2F%2Fpad.exegetes.eu.org%2Fp%2Fg.DSXI1kGFT1gjor66%24Abro-REP-Tele2-Garde
+DOSSIER=MonDossier$$
+PROJET=Abro2$$
+
+OUTPUT=$(./cocktail -v \
+           -d "$DOSSIER" \
+           -p "$PROJET" \
+           -b "$URL_BASE" \
+           -g "$URL_GARDE" 2>&1 >/dev/null) 
+RC=$?
+echo -n "RC=$RC "
+if test "$RC" -ne "0";
+then
+  # Test raté
+  echo "[FAILED]"
+else
+  echo "[  OK  ]"
+fi
+echo "$OUTPUT"
+
+exit "$RC"
+

+ 33 - 0
t/05_1c_1d_1p_priv_export

@@ -0,0 +1,33 @@
+#!/bin/bash
+
+printf "$PRINTFPATTERN" $0 : "1 Compilation. 1 Dossier. 1 Projet. Pad Privé. export/txt"
+
+if test "$TRAVIS" == "true";
+then
+  echo "[ SKIP ]"
+  exit 0
+fi
+
+URL_BASE=https%3A%2F%2Fpad.exegetes.eu.org%2Fgroup.html%2F19%2Fpad.html%2Fg.STVKtWnA83RsmVUC%24Abro2-PRIVE%2Fexport%2Ftxt
+URL_GARDE=https%3A%2F%2Fpad.exegetes.eu.org%2Fgroup.html%2F19%2Fpad.html%2Fg.STVKtWnA83RsmVUC%24Abro2Garde-PRIVE%2Fexport%2Ftxt
+DOSSIER=MonDossier$$
+PROJET=Abro$$
+
+OUTPUT=$(./cocktail -v \
+           -d "$DOSSIER" \
+           -p "$PROJET" \
+           -b "$URL_BASE" \
+           -g "$URL_GARDE" 2>&1 >/dev/null) 
+RC=$?
+echo -n "RC=$RC "
+if test "$RC" -ne "0";
+then
+  # Test raté
+  echo "[FAILED]"
+else
+  echo "[  OK  ]"
+fi
+echo "$OUTPUT"
+
+exit "$RC"
+

+ 33 - 0
t/06_1c_1d_1p_priv

@@ -0,0 +1,33 @@
+#!/bin/bash
+
+printf "$PRINTFPATTERN" $0 : "1 Compilation. 1 Dossier. 1 Projet. Pad Privé."
+
+if test "$TRAVIS" == "true";
+then
+  echo "[ SKIP ]"
+  exit 0
+fi
+
+URL_BASE=https%3A%2F%2Fpad.exegetes.eu.org%2Fgroup.html%2F19%2Fpad.html%2Fg.STVKtWnA83RsmVUC%24Abro2-PRIVE
+URL_GARDE=https%3A%2F%2Fpad.exegetes.eu.org%2Fgroup.html%2F19%2Fpad.html%2Fg.STVKtWnA83RsmVUC%24Abro2Garde-PRIVE
+DOSSIER=MonDossier$$
+PROJET=Abro$$
+
+OUTPUT=$(./cocktail -v \
+           -d "$DOSSIER" \
+           -p "$PROJET" \
+           -b "$URL_BASE" \
+           -g "$URL_GARDE" 2>&1 >/dev/null) 
+RC=$?
+echo -n "RC=$RC "
+if test "$RC" -ne "0";
+then
+  # Test raté
+  echo "[FAILED]"
+else
+  echo "[  OK  ]"
+fi
+echo "$OUTPUT"
+
+exit "$RC"
+

+ 33 - 0
t/alltests

@@ -0,0 +1,33 @@
+#!/bin/bash
+MAXRC=0
+testOK=0
+testFAILED=0
+testCOUNT=0
+export PRINTFPATTERN='%-31s %s %-70s'
+for test in t/*;
+do
+  if test -x "$test" -a "$test" != "$0";
+  then
+    testCOUNT=$(($testCOUNT + 1))
+    echo -n "[$testCOUNT]    "
+    $test
+    RC=$?
+    printf "RC:=(%d) (%s)\n\n" $RC $test
+    if test "$RC" -ne "0";
+    then
+      MAXRC="$RC"
+      testFAILED=$(($testFAILED + 1))
+    else
+      testOK=$(($testOK + 1))
+    fi
+  fi
+done
+
+if test "$MAXRC" -eq "0";
+then
+  echo "All tests : OK:$testOK/$testCOUNT FAILED:$testFAILED/$testCOUNT [  OK  ]"
+else
+  echo "All tests : OK:$testOK/$testCOUNT FAILED:$testFAILED/$testCOUNT [FAILED]"
+fi
+
+exit $MAXRC