* [gentoo-commits] gentoo-projects commit in portage-utils/tests/qfile: dotest
@ 2011-03-01 5:00 Mike Frysinger (vapier)
0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2011-03-01 5:00 UTC (permalink / raw
To: gentoo-commits
vapier 11/03/01 05:00:25
Modified: dotest
Log:
use new common code
Revision Changes Path
1.3 portage-utils/tests/qfile/dotest
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?r1=1.2&r2=1.3
Index: dotest
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/qfile/dotest,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dotest 13 Jan 2007 19:17:40 -0000 1.2
+++ dotest 1 Mar 2011 05:00:25 -0000 1.3
@@ -1,16 +1,16 @@
#!/bin/bash
-QFILE='../../q file'
+. ../init.sh
TEST_CASES=( \
- [1]="${QFILE} -Cq /bin/bash /bin/XXXXX" \
- [2]="${QFILE} -Co /bin/bash /bin/XXXXX" \
- [3]="echo -e \"/bin/bash\n/bin/XXXXX\" | ${QFILE} -Cq -f -" \
- [4]="echo -e \"/bin/bash\n/bin/XXXXX\" | ${QFILE} -Co -f -" \
- [5]="${QFILE} -Co -x bash /bin/bash" \
- [6]="${QFILE} -Co -x app-shells/bash /bin/bash" \
- [7]="${QFILE} -Co -x bash:0 /bin/bash" \
- [8]="${QFILE} -Co -x app-shells/bash:0 /bin/bash" \
+ [1]="q file -Cq /bin/bash /bin/XXXXX" \
+ [2]="q file -Co /bin/bash /bin/XXXXX" \
+ [3]="echo -e \"/bin/bash\n/bin/XXXXX\" | q file -Cq -f -" \
+ [4]="echo -e \"/bin/bash\n/bin/XXXXX\" | q file -Co -f -" \
+ [5]="q file -Co -x bash /bin/bash" \
+ [6]="q file -Co -x app-shells/bash /bin/bash" \
+ [7]="q file -Co -x bash:0 /bin/bash" \
+ [8]="q file -Co -x app-shells/bash:0 /bin/bash" \
)
EXPECTED_RESULTS=( \
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils/tests/qfile: dotest
@ 2011-12-18 6:49 Mike Frysinger (vapier)
0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2011-12-18 6:49 UTC (permalink / raw
To: gentoo-commits
vapier 11/12/18 06:49:06
Modified: dotest
Log:
add nice colors to test output
Revision Changes Path
1.4 portage-utils/tests/qfile/dotest
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?r1=1.3&r2=1.4
Index: dotest
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/qfile/dotest,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- dotest 1 Mar 2011 05:00:25 -0000 1.3
+++ dotest 18 Dec 2011 06:49:06 -0000 1.4
@@ -29,10 +29,8 @@
echo "Test #${i} failed: ${TEST_CASES[$i]}" > /dev/stderr
echo " - expected result was: ${EXPECTED_RESULTS[$i]}" > /dev/stderr
echo " - actual result was: $(eval ${TEST_CASES[$i]})" > /dev/stderr
- echo FAILED
- exit 1
+ fail
fi
done
-echo PASSED
-exit 0
+pass
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils/tests/qfile: dotest
@ 2011-12-22 19:09 Mike Frysinger (vapier)
0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2011-12-22 19:09 UTC (permalink / raw
To: gentoo-commits
vapier 11/12/22 19:09:31
Modified: dotest
Log:
simplify test code a bit
Revision Changes Path
1.5 portage-utils/tests/qfile/dotest
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?r1=1.4&r2=1.5
Index: dotest
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/qfile/dotest,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dotest 18 Dec 2011 06:49:06 -0000 1.4
+++ dotest 22 Dec 2011 19:09:31 -0000 1.5
@@ -2,33 +2,44 @@
. ../init.sh
-TEST_CASES=( \
- [1]="q file -Cq /bin/bash /bin/XXXXX" \
- [2]="q file -Co /bin/bash /bin/XXXXX" \
- [3]="echo -e \"/bin/bash\n/bin/XXXXX\" | q file -Cq -f -" \
- [4]="echo -e \"/bin/bash\n/bin/XXXXX\" | q file -Co -f -" \
- [5]="q file -Co -x bash /bin/bash" \
- [6]="q file -Co -x app-shells/bash /bin/bash" \
- [7]="q file -Co -x bash:0 /bin/bash" \
- [8]="q file -Co -x app-shells/bash:0 /bin/bash" \
-)
+tests=(
+ "q file -Cq /bin/bash /bin/XXXXX"
+ "app-shells/bash"
+
+ "q file -Co /bin/bash /bin/XXXXX"
+ "/bin/XXXXX"
+
+ "echo -e \"/bin/bash\n/bin/XXXXX\" | q file -Cq -f -"
+ "app-shells/bash"
+
+ "echo -e \"/bin/bash\n/bin/XXXXX\" | q file -Co -f -"
+ "/bin/XXXXX"
-EXPECTED_RESULTS=( \
- [1]="app-shells/bash" \
- [2]="/bin/XXXXX" \
- [3]="app-shells/bash" \
- [4]="/bin/XXXXX" \
- [5]="/bin/bash" \
- [6]="/bin/bash" \
- [7]="/bin/bash" \
- [8]="/bin/bash" \
+ "q file -Co -x bash /bin/bash"
+ "/bin/bash"
+
+ "q file -Co -x app-shells/bash /bin/bash"
+ "/bin/bash"
+
+ "q file -Co -x bash:0 /bin/bash"
+ "/bin/bash"
+
+ "q file -Co -x app-shells/bash:0 /bin/bash"
+ "/bin/bash"
)
-for i in `seq 1 ${#TEST_CASES[@]}` ; do
- if [[ $(eval ${TEST_CASES[$i]}) != "${EXPECTED_RESULTS[$i]}" ]]; then
- echo "Test #${i} failed: ${TEST_CASES[$i]}" > /dev/stderr
- echo " - expected result was: ${EXPECTED_RESULTS[$i]}" > /dev/stderr
- echo " - actual result was: $(eval ${TEST_CASES[$i]})" > /dev/stderr
+set -- "${tests[@]}"
+while [[ $# -gt 0 ]] ; do
+ test=$1; shift
+ exp=$1; shift
+
+ res=$(eval ${test})
+ if [[ "${res}" != "${exp}" ]] ; then
+ (
+ echo "Test failed: ${test}"
+ echo " - expected result was: ${exp}"
+ echo " - actual result was: ${res}"
+ ) > /dev/stderr
fail
fi
done
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils/tests/qfile: dotest
@ 2011-12-22 19:30 Mike Frysinger (vapier)
0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2011-12-22 19:30 UTC (permalink / raw
To: gentoo-commits
vapier 11/12/22 19:30:47
Modified: dotest
Log:
redo test output to get info on a per-test basis
Revision Changes Path
1.6 portage-utils/tests/qfile/dotest
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.6&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.6&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?r1=1.5&r2=1.6
Index: dotest
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/qfile/dotest,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dotest 22 Dec 2011 19:09:31 -0000 1.5
+++ dotest 22 Dec 2011 19:30:46 -0000 1.6
@@ -34,14 +34,13 @@
exp=$1; shift
res=$(eval ${test})
- if [[ "${res}" != "${exp}" ]] ; then
+ [[ "${res}" == "${exp}" ]]
+ if ! tend $? "${test}" ; then
(
- echo "Test failed: ${test}"
echo " - expected result was: ${exp}"
echo " - actual result was: ${res}"
) > /dev/stderr
- fail
fi
done
-pass
+end
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils/tests/qfile: dotest
@ 2012-10-28 9:44 Mike Frysinger (vapier)
0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2012-10-28 9:44 UTC (permalink / raw
To: gentoo-commits
vapier 12/10/28 09:44:25
Modified: dotest
Log:
qfile: fix handling of paths relative to pwd #362643 by Jeremy Olexa
Revision Changes Path
1.7 portage-utils/tests/qfile/dotest
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/qfile/dotest?r1=1.6&r2=1.7
Index: dotest
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/qfile/dotest,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- dotest 22 Dec 2011 19:30:46 -0000 1.6
+++ dotest 28 Oct 2012 09:44:24 -0000 1.7
@@ -26,6 +26,12 @@
"q file -Co -x app-shells/bash:0 /bin/bash"
"/bin/bash"
+
+ "(cd /bin; q file -Cq bash)"
+ "app-shells/bash"
+
+ "(cd /; q file -Co bash)"
+ "bash"
)
set -- "${tests[@]}"
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-10-28 9:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-22 19:09 [gentoo-commits] gentoo-projects commit in portage-utils/tests/qfile: dotest Mike Frysinger (vapier)
-- strict thread matches above, loose matches on Subject: below --
2012-10-28 9:44 Mike Frysinger (vapier)
2011-12-22 19:30 Mike Frysinger (vapier)
2011-12-18 6:49 Mike Frysinger (vapier)
2011-03-01 5:00 Mike Frysinger (vapier)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox