gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, cmake, updated. 582c08d3795cec69eae28f95


From: Juergen Kahrs
Subject: [gawk-diffs] [SCM] gawk branch, cmake, updated. 582c08d3795cec69eae28f9513c65d21ad0a13e8
Date: Sat, 04 May 2013 10:02:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, cmake has been updated
       via  582c08d3795cec69eae28f9513c65d21ad0a13e8 (commit)
      from  6e8392351cfc4c8f489feac3c07edeacfe6d8949 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=582c08d3795cec69eae28f9513c65d21ad0a13e8

commit 582c08d3795cec69eae28f9513c65d21ad0a13e8
Author: Juergen Kahrs <address@hidden>
Date:   Sat May 4 12:02:15 2013 +0200

    Non-standard test cases like testext shall be implemented as shell 
functions.

diff --git a/cmake/basictest b/cmake/basictest
index 575f1c8..5e9010a 100755
--- a/cmake/basictest
+++ b/cmake/basictest
@@ -1,9 +1,18 @@
 #!/bin/sh
 
+# Use this for debugging the test cases.
+# The resulting textual output will not destroy the test cases.
+set -x
+# After test case execution, the output can be found in
+# build/Testing/Temporary/LastTest.log
+
 export PATH=$PATH:/c/MinGW/msys/1.0/bin
+export GAWKEXE=$1
+export TESTCASE=$2
+export OPTION=$3
 TESTHOME=$(dirname ${0})/../test
 export AWKPATH=${TESTHOME}
-export AWKLIBPATH=$(dirname ${1})/extension/
+export AWKLIBPATH=$(dirname ${GAWKEXE})/extension/
 export LANG=C
 # Is this shell running in a native MinGW shell (MSYS) ?
 if test -n "$COMSPEC"; then
@@ -13,11 +22,27 @@ else
   # This is a shell running in Unix environment.
   COMPARE="cmp"
 fi
-if test -r ${TESTHOME}/${2}.in
+
+# Each test case that cannot be handle in the "standard way" shall
+# be implemented as a function here.
+function testext() {
+  $GAWKEXE '/^(@load|BEGIN)/,/^}/' ${TESTHOME}/../extension/testext.c > 
testext.awk
+  $GAWKEXE -f ${TESTCASE}.awk  > ${TESTHOME}/_${TESTCASE} 2>&1 || echo EXIT 
CODE: $? >> ${TESTHOME}/_${TESTCASE}
+  rm -f testext.awk
+}
+
+# Is this test case implemented as a function ?
+if [ "$( type -t $TESTCASE )" = "function" ]
+then
+  $TESTCASE
+# If no function exists, then treat the test case in standard way.
+elif test -r ${TESTHOME}/${TESTCASE}.in
+# Any existing .in file will be redirected to standard input.
 then
-  $1 $3 -f ${2}.awk  < ${TESTHOME}/${2}.in > ${TESTHOME}/_${2} 2>&1 || echo 
EXIT CODE: $? >> ${TESTHOME}/_${2}
+  $GAWKEXE ${OPTION} -f ${TESTCASE}.awk  < ${TESTHOME}/${TESTCASE}.in > 
${TESTHOME}/_${TESTCASE} 2>&1 || echo EXIT CODE: $? >> ${TESTHOME}/_${TESTCASE}
 else
-  $1 $3 -f ${2}.awk                        > ${TESTHOME}/_${2} 2>&1 || echo 
EXIT CODE: $? >> ${TESTHOME}/_${2}
+  $GAWKEXE ${OPTION} -f ${TESTCASE}.awk                        > 
${TESTHOME}/_${TESTCASE} 2>&1 || echo EXIT CODE: $? >> ${TESTHOME}/_${TESTCASE}
 fi
-${COMPARE} ${TESTHOME}/${2}.ok ${TESTHOME}/_${2} && rm -f ${TESTHOME}/_${2}
+# Compare the actual output with the expected (correct) output.
+${COMPARE} ${TESTHOME}/${TESTCASE}.ok ${TESTHOME}/_${TESTCASE} && rm -f 
${TESTHOME}/_${TESTCASE}
 
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8e0eb39..6b085e0 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -43,11 +43,11 @@ foreach(testgroup ${ALL_GROUPS} )
   # Some test cases are special, treat them accordingly.
   foreach(testcase ${ONE_GROUP} )
     set(options "")
-    set(suffix  "")
+    set(file_suffix  "")
     if(${testcase} STREQUAL lintold)
       set(options "--lint-old")
     elseif(
-       ${testcase} STREQUAL defref     OR ${testcase} STREQUAL fmtspcl       OR
+       ${testcase} STREQUAL defref     OR
        ${testcase} STREQUAL lintwarn   OR ${testcase} STREQUAL noeffect      OR
        ${testcase} STREQUAL nofmtch    OR ${testcase} STREQUAL shadow        OR
        ${testcase} STREQUAL uninit2    OR ${testcase} STREQUAL uninit3       OR
@@ -63,7 +63,7 @@ foreach(testgroup ${ALL_GROUPS} )
        ${testcase} STREQUAL rsstart2   OR ${testcase} STREQUAL strftime      OR
        ${testcase} STREQUAL readdir
       )
-      set(suffix  "_HANGS")
+      set(file_suffix  "_HANGS")
     # These are the test cases that fail.
     # Some of them may reveal genuine bugs.
     # Most of them fail because they need to be invoked with a special 
parameter.
@@ -104,13 +104,16 @@ foreach(testgroup ${ALL_GROUPS} )
        ${testcase} STREQUAL rsstart3   OR ${testcase} STREQUAL rtlen         OR
        ${testcase} STREQUAL rtlen01    OR ${testcase} STREQUAL rtlenmb       OR
        ${testcase} STREQUAL space      OR ${testcase} STREQUAL strftlng      OR
-       ${testcase} STREQUAL symtab6    OR ${testcase} STREQUAL symtab8       OR
-       ${testcase} STREQUAL testext
+       ${testcase} STREQUAL symtab6    OR ${testcase} STREQUAL symtab8
       )
-      set(suffix  "_FAILS")
+      set(file_suffix  "_FAILS")
     endif()
 
-    add_test(${testcase} ${SHELL_PREFIX} ${CMAKE_SOURCE_DIR}/cmake/basictest 
${CMAKE_BINARY_DIR}/gawk ${testcase}${suffix}  ${options} )
+    if ("${file_suffix}" STREQUAL "")
+      add_test("${testgroup}.${testcase}" ${SHELL_PREFIX} 
${CMAKE_SOURCE_DIR}/cmake/basictest ${CMAKE_BINARY_DIR}/gawk 
${testcase}${file_suffix}  ${options} )
+    else()
+      message(STATUS "Skipping test case ${testgroup}.${testcase}")
+    endif()
   endforeach(testcase)
 
 endforeach(testgroup)

-----------------------------------------------------------------------

Summary of changes:
 cmake/basictest     |   35 ++++++++++++++++++++++++++++++-----
 test/CMakeLists.txt |   17 ++++++++++-------
 2 files changed, 40 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]