]> granicus.if.org Git - check/commitdiff
test_check_nofork: removing assumption that HAVE_FORK=0 implied Windows
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Fri, 27 Sep 2013 01:38:43 +0000 (01:38 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Fri, 27 Sep 2013 01:38:43 +0000 (01:38 +0000)
With the configuration option --disable-fork, *nix systems
can also be compiled without using fork. To fix the
line encoding, sed is used to remove \r before the check.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@804 64e312b2-a51f-0410-8e61-82d0ca0eb02a

tests/test_check_nofork.sh

index 671bd7bf766abfe16cb091b250de955b55b6ab72..7ad46338f844bb7e982b7cccb4f169dac23c8441 100755 (executable)
@@ -1,25 +1,16 @@
 #!/bin/sh
 
-# For this test script, it is assumed that HAVE_FORK=0 implies
-# running in a Windows environment. That means not only are
-# fork-related tests not run, but also line endings are important.
-# In *NIX environments line endings are \n, but in Windows they
-# are expected to be \r\n. For this reason, HAVE_FORK=0 uses
-# printf to generate the comparison strings, so the line endings
-# can be controlled.
-
 . ./test_vars
 
 if [ $HAVE_FORK -eq 1 ]; then
 expected="Running suite(s): NoFork
 0%: Checks: 1, Failures: 1, Errors: 0"
 else
-expected=`printf "Running suite(s): NoFork\r
-0%%: Checks: 1, Failures: 1, Errors: 0\r
-"`
+expected="Running suite(s): NoFork
+0%: Checks: 1, Failures: 1, Errors: 0"
 fi
 
-actual=`./check_nofork${EXEEXT}`
+actual=`./check_nofork${EXEEXT} | sed 's/\r//g'`
 if [ x"${expected}" = x"${actual}" ]; then
   exit 0
 else
@@ -28,10 +19,5 @@ else
   echo "${expected}"
   echo "Got: "
   echo "${actual}"
-  
-  echo xxd expected
-  echo -n "${expected}" | xxd
-  echo xxd actual
-  echo -n "${actual}" | xxd
   exit 1
 fi