[postgis-devel] loader/dumper tests support

Michael Fuhr mike at fuhr.org
Fri Jun 16 08:55:13 PDT 2006


On Fri, Jun 16, 2006 at 04:29:03PM +0100, Mark Cave-Ayland wrote:
> I've just compiled and run the regression tests from the latest
> postgis-cvs.tar.gz, and all of the tests pass under Win32. Do you think it
> is time for another release to resolve this and the nasty distance()
> function bug? Or should we wait for the SVN upgrade first? ;)

Solaris and FreeBSD both have trouble with the new regression tests.
Function definitions should be

  fail ()

instead of

  function fail ()

Using the latter style gives syntax errors on both FreeBSD and
Solaris:

  ./run_test: syntax error at line 47: `(' unexpected

Echo without linefeed is different on various platforms.  PostgreSQL's
regression tests do the following:

  if echo '\c' | grep c >/dev/null 2>&1; then
      ECHO_N='echo -n'
      ECHO_C=''
  else
      ECHO_N='echo'
      ECHO_C='\c'
  fi

Then, to echo text without a linefeed:

  $ECHO_N "something... $ECHO_C"

I'd suggest doing the same, else some platforms give output like
the following with "echo -ne":

  -ne  loader/mlines2d
  .............. ok
  -ne  loader/mlines3dz
  .............. ok

After the function definition and echo fixes, Solaris has yet more
errors:

   loader/mlines2d.../run_test: !: not found
  .../run_test: !: not found
  .../run_test: !: not found
  .../run_test: !: not found
  .../run_test: !: not found

The problem is lines like this:

  if ! run_simple_test ${TEST}.sql ${TEST}-wkb.expected "wkb insert"; then
          return 1
  fi

Apparently /bin/sh on Solaris doesn't recognize "!".  One way to
handle this is to do nothing for the true condition; I'll have to
do more research to see if there's a better way.

  if run_simple_test ${TEST}.sql ${TEST}-wkb.expected "wkb insert"; then
          :
  else
          return 1
  fi

With all of the above changes, Solaris/sparc fails the mlines tests:

 loader/mlines2d... failed (wkb insert: diff expected obtained: /tmp/pgis_reg_2180/test_1_diff)
 loader/mlines3dz... failed (wkb insert: diff expected obtained: /tmp/pgis_reg_2180/test_2_diff)
 loader/mlines3dm... failed (wkb insert: diff expected obtained: /tmp/pgis_reg_2180/test_3_diff)
 loader/mlines4d... failed (wkb insert: diff expected obtained: /tmp/pgis_reg_2180/test_4_diff)

I've attached one of the diffs -- is it a byte order problem?

-- 
Michael Fuhr
-------------- next part --------------
1,2c1,2
< 1|1|01050000000200000001020000000200000000000000000000000000000000000000000000000000F03F000000000000F03F0102000000020000000000000000000840000000000000084000000000000010400000000000001040
< 2|2|01050000000300000001020000000200000000000000000000000000000000000000000000000000F03F000000000000F03F0102000000020000000000000000000840000000000000084000000000000010400000000000001040010200000003000000000000000000244000000000000024400000000000001440000000000000144000000000000008400000000000000840
---
> 1|1|000000000500000002000000000200000002000000000000000000000000000000003FF00000000000003FF00000000000000000000002000000024008000000000000400800000000000040100000000000004010000000000000
> 2|2|000000000500000003000000000200000002000000000000000000000000000000003FF00000000000003FF00000000000000000000002000000024008000000000000400800000000000040100000000000004010000000000000000000000200000003402400000000000040240000000000004014000000000000401400000000000040080000000000004008000000000000


More information about the postgis-devel mailing list