test.r.timestamp.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # This is a simple timestamp check, creation and removal test
  2. # We need to set a specific region in the
  3. # @preprocess step of this test. We generate
  4. # raster data with r.mapcalc.
  5. # The region setting should work for UTM and LL test locations
  6. g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
  7. # Lets gerenate a test map
  8. r.mapcalc --o expr="map = 1"
  9. # The first @test uses several different absolute datum formats
  10. r.timestamp map=map date=none
  11. r.timestamp map=map
  12. r.timestamp map=map date="2003"
  13. r.timestamp map=map
  14. r.timestamp map=map date="Jul 2003"
  15. r.timestamp map=map
  16. r.timestamp map=map date="14 Jul 2003"
  17. r.timestamp map=map
  18. r.timestamp map=map date="14 Jul 2003 10"
  19. r.timestamp map=map
  20. r.timestamp map=map date="14 Jul 2003 10:30 +0700"
  21. r.timestamp map=map
  22. r.timestamp map=map date="14 Jul 2003 10:30:25"
  23. r.timestamp map=map
  24. r.timestamp map=map date="14 Jul 2003 10:30:25 +0700 / 15 Jul 2003 11:35:12 +0700"
  25. r.timestamp map=map
  26. r.timestamp map=map date="14 Jul 2003 10:30:25 +0700 / 15 Jul 2003"
  27. r.timestamp map=map
  28. r.timestamp map=map date=none
  29. r.timestamp map=map
  30. # The second @test uses several different relative datum formats
  31. r.timestamp map=map date=none
  32. r.timestamp map=map
  33. r.timestamp map=map date="2 years"
  34. r.timestamp map=map
  35. r.timestamp map=map date="2 years 3 months"
  36. r.timestamp map=map
  37. r.timestamp map=map date="5 days"
  38. r.timestamp map=map
  39. r.timestamp map=map date="3 hours"
  40. r.timestamp map=map
  41. r.timestamp map=map date="5 minutes 30 seconds"
  42. r.timestamp map=map
  43. r.timestamp map=map date="2 years 2 months / 5 years 8 months"
  44. r.timestamp map=map
  45. r.timestamp map=map date=none
  46. # The third @test to check @failure with wrong time stamps
  47. g.message message="Now checking for expected failures due to wrong time stamps..."
  48. r.timestamp map=map date="2 years 3 months 8 days"
  49. r.timestamp map=map date="1 month 5 days"
  50. r.timestamp map=map date="July 2003"
  51. r.timestamp map=map date="14 Jul 2003 +0700"