PageRenderTime 27ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/brlcad/tags/rel-7-12-2/bench/viewdiff.sh

https://bitbucket.org/vrrm/brl-cad-copy-for-fast-history-browsing-in-git
Shell | 183 lines | 129 code | 1 blank | 53 comment | 1 complexity | 22e84c4d2074d76f9a1d164e0520f371 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, LGPL-2.1, Apache-2.0, AGPL-3.0, LGPL-3.0, GPL-3.0, MPL-2.0-no-copyleft-exception, CC-BY-SA-3.0, 0BSD, BSD-3-Clause
  1. #!/bin/sh
  2. # V I E W D I F F . S H
  3. # BRL-CAD
  4. #
  5. # Copyright (c) 2004-2008 United States Government as represented by
  6. # the U.S. Army Research Laboratory.
  7. #
  8. # Redistribution and use in source and binary forms, with or without
  9. # modification, are permitted provided that the following conditions
  10. # are met:
  11. #
  12. # 1. Redistributions of source code must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. #
  15. # 2. Redistributions in binary form must reproduce the above
  16. # copyright notice, this list of conditions and the following
  17. # disclaimer in the documentation and/or other materials provided
  18. # with the distribution.
  19. #
  20. # 3. The name of the author may not be used to endorse or promote
  21. # products derived from this software without specific prior written
  22. # permission.
  23. #
  24. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
  25. # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  26. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  28. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  30. # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  31. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  32. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  33. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  34. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. #
  36. ###
  37. # A Shell script to view the differences of a benchmark run,
  38. # displaying the results in a framebuffer window.
  39. #
  40. # The following environment variables will modify how the view diff
  41. # behaves (in case you're not running from a source distribution, for
  42. # example):
  43. #
  44. # PIX - the directory containing the pix files to be compare
  45. # PIXDIFF - the name of a pix diff tool
  46. # PIXFB - the name of a pix to framebuffer tool (e.g. pix-fb)
  47. #
  48. # Authors -
  49. # Mike Muuss
  50. # Christopher Sean Morrison
  51. #
  52. # @(#)$Header$
  53. # Ensure /bin/sh
  54. export PATH || (echo "This isn't sh."; sh $0 $*; kill $$)
  55. path_to_this="`dirname $0`"
  56. echo Looking for benchmark images ...
  57. # find pix reference image directory if we do not already know where
  58. # it is. PIX environment variable overrides
  59. if test "x${PIX}" = "x" ; then
  60. if test -f "$path_to_this/../pix/sphflake.pix" ; then
  61. echo ...found .pix image files in $path_to_this/../pix
  62. PIX="$path_to_this/../pix"
  63. elif test -f "$path_to_this/sphflake.pix" ; then
  64. echo ...found .pix image files in $path_to_this
  65. PIX="$path_to_this"
  66. elif test -f "$path_to_this/../share/brlcad/pix/sphflake.pix" ; then
  67. echo ...found .pix image files in $path_to_this/../share/brlcad/pix
  68. PIX="$path_to_this/../share/brlcad/pix"
  69. fi
  70. else
  71. echo ...using $PIX from PIX environment variable setting
  72. fi
  73. echo Checking for pixel diff utility...
  74. # find pixel diff utility
  75. # PIXDIFF environment variable overrides
  76. if test "x${PIXDIFF}" = "x" ; then
  77. if test -x $path_to_this/pixdiff ; then
  78. echo ...found $path_to_this/pixdiff
  79. PIXDIFF="$path_to_this/pixdiff"
  80. elif test -x $path_to_this/../src/util/pixdiff ; then
  81. echo ...found $path_to_this/../src/util/pixdiff
  82. PIXDIFF="$path_to_this/../src/util/pixdiff"
  83. else
  84. if test -f "$path_to_this/../src/util/pixdiff.c" ; then
  85. echo ...need to build pixdiff
  86. for compiler in $CC gcc cc ; do
  87. COMPILE="$compiler"
  88. if test "x$COMPILE" = "x" ; then
  89. continue
  90. fi
  91. $COMPILE -o pixdiff "$path_to_this/../src/util/pixdiff.c"
  92. if test "x$?" = "x0" ; then
  93. break
  94. fi
  95. if test -f "pixdiff" ; then
  96. break;
  97. fi
  98. done
  99. if test -f "pixdiff" ; then
  100. echo ...built pixdiff with $COMPILE -o pixdiff pixdiff.c
  101. PIXDIFF="./pixdiff"
  102. fi
  103. fi
  104. fi
  105. else
  106. echo ...using $PIXDIFF from PIXDIFF environment variable setting
  107. fi
  108. echo Checking for pix to framebuffer utility...
  109. # find pix to framebuffer utility
  110. # PIXFB environment variable overrides
  111. if test "x${PIXFB}" = "x" ; then
  112. if test -x $path_to_this/pix-fb ; then
  113. echo ...found $path_to_this/pix-fb
  114. PIXFB="$path_to_this/pix-fb"
  115. elif test -x $path_to_this/../src/fb/pix-fb ; then
  116. echo ...found $path_to_this/../src/fb/pix-fb
  117. PIXFB="$path_to_this/../src/fb/pix-fb"
  118. else
  119. if test -f "$path_to_this/../src/fb/pix-fb.c" ; then
  120. echo ...need to build pix-fb
  121. for compiler in $CC gcc cc ; do
  122. COMPILE="$compiler"
  123. if test "x$COMPILE" = "x" ; then
  124. continue
  125. fi
  126. $COMPILE -o pix-fb "$path_to_this/../src/fb/pix-fb.c"
  127. if test "x$?" = "x0" ; then
  128. break
  129. fi
  130. if test -f "pix-fb" ; then
  131. break;
  132. fi
  133. done
  134. if test -f "pix-fb" ; then
  135. echo ...built pix-fb with $COMPILE -o pix-fb pix-fb.c
  136. PIXFB="./pix-fb"
  137. fi
  138. fi
  139. fi
  140. else
  141. echo ...using $PIXFB from PIXFB environment variable setting
  142. fi
  143. echo +++++ moss.pix
  144. ${PIXDIFF} ${PIX}/moss.pix moss.pix | ${PIXFB}
  145. echo +++++ world.pix
  146. ${PIXDIFF} ${PIX}/world.pix world.pix | ${PIXFB}
  147. echo +++++ star.pix
  148. ${PIXDIFF} ${PIX}/star.pix star.pix | ${PIXFB}
  149. echo +++++ bldg391.pix
  150. ${PIXDIFF} ${PIX}/bldg391.pix bldg391.pix | ${PIXFB}
  151. echo +++++ m35.pix
  152. ${PIXDIFF} ${PIX}/m35.pix m35.pix | ${PIXFB}
  153. echo +++++ sphflake.pix
  154. ${PIXDIFF} ${PIX}/sphflake.pix sphflake.pix | ${PIXFB}
  155. # Local Variables:
  156. # mode: sh
  157. # tab-width: 8
  158. # sh-indentation: 4
  159. # sh-basic-offset: 4
  160. # indent-tabs-mode: t
  161. # End:
  162. # ex: shiftwidth=4 tabstop=8