Skip to content
Permalink
Browse files

testsuite overhaul -- all temp files end up in build, runtest.py call…

…ed directly and the run.py files shrink down to the bare minimum. Similar to the recent changes in OIIO testsuite.
  • Loading branch information...
lgritz committed Mar 10, 2012
1 parent 12f821f commit fc7b1a50b690ccaa20525c24a81d6d612defc8c8
Showing with 338 additions and 2,347 deletions.
  1. +1 −9 .gitignore
  2. +16 −11 Makefile
  3. +36 −6 src/CMakeLists.txt
  4. +0 −71 src/cmake/CMakeUserUseBison.cmake
  5. +0 −46 src/cmake/CMakeUserUseFlex.cmake
  6. +0 −7 src/cmake/oiio.cmake
  7. +8 −0 src/doc/.gitignore
  8. +1 −25 testsuite/arithmetic/run.py
  9. +1 −25 testsuite/array-derivs/run.py
  10. +1 −26 testsuite/array-range/run.py
  11. +1 −25 testsuite/array/run.py
  12. +3 −0 testsuite/blackbody/ref/out.txt
  13. +2 −25 testsuite/blackbody/run.py
  14. +1 −25 testsuite/blendmath/run.py
  15. +1 −25 testsuite/breakcont/run.py
  16. +1 −25 testsuite/bug-locallifetime/run.py
  17. +1 −25 testsuite/cellnoise/run.py
  18. +1 −25 testsuite/closure/run.py
  19. +1 −25 testsuite/color/run.py
  20. +1 −25 testsuite/comparison/run.py
  21. +1 −26 testsuite/component-range/run.py
  22. +1 −25 testsuite/const-array-params/run.py
  23. +1 −0 testsuite/debugnan/ref/out.txt
  24. +1 −25 testsuite/debugnan/run.py
  25. +1 −25 testsuite/derivs-muldiv-clobber/run.py
  26. +1 −25 testsuite/derivs/run.py
  27. +1 −25 testsuite/error-dupes/run.py
  28. +1 −25 testsuite/exponential/run.py
  29. +1 −25 testsuite/function-earlyreturn/run.py
  30. +1 −25 testsuite/function-outputelem/run.py
  31. +1 −25 testsuite/function-simple/run.py
  32. +1 −25 testsuite/geomath/run.py
  33. +2 −25 testsuite/getsymbol-nonheap/run.py
  34. +1 −0 testsuite/gettextureinfo/ref/out.txt
  35. +1 −25 testsuite/gettextureinfo/run.py
  36. +1 −25 testsuite/hyperb/run.py
  37. +1 −25 testsuite/ieee_fp/run.py
  38. +1 −25 testsuite/if/run.py
  39. +1 −25 testsuite/incdec/run.py
  40. +1 −25 testsuite/initops/run.py
  41. +1 −25 testsuite/intbits/run.py
  42. +1 −27 testsuite/layers-lazy/run.py
  43. +1 −26 testsuite/layers/run.py
  44. +1 −26 testsuite/lazyglobals/run.py
  45. +1 −25 testsuite/logic/run.py
  46. +1 −25 testsuite/loop/run.py
  47. +1 −0 testsuite/matrix/ref/out.txt
  48. +1 −25 testsuite/matrix/run.py
  49. +1 −26 testsuite/message/run.py
  50. +1 −25 testsuite/miscmath/run.py
  51. +5 −0 testsuite/missing-shader/ref/out.txt
  52. +1 −24 testsuite/missing-shader/run.py
  53. +2 −26 testsuite/noise-cell/run.py
  54. +5 −26 testsuite/noise-gabor/run.py
  55. +4 −25 testsuite/noise-gabor2d-filter/run.py
  56. +4 −25 testsuite/noise-gabor3d-filter/run.py
  57. +5 −26 testsuite/noise-perlin/run.py
  58. +5 −26 testsuite/noise-uperlin/run.py
  59. +4 −25 testsuite/noise/run.py
  60. +1 −24 testsuite/oslc-empty/run.py
  61. +3 −24 testsuite/oslc-err-noreturn/run.py
  62. +3 −24 testsuite/oslc-err-paramdefault/run.py
  63. +2 −26 testsuite/pnoise-cell/run.py
  64. +2 −26 testsuite/pnoise-gabor/run.py
  65. +2 −26 testsuite/pnoise-perlin/run.py
  66. +2 −26 testsuite/pnoise-uperlin/run.py
  67. +1 −25 testsuite/pnoise/run.py
  68. +1 −25 testsuite/raytype/run.py
  69. +0 −18 testsuite/run-template.py
  70. +140 −30 testsuite/runtest.py
  71. +1 −25 testsuite/shortcircuit/run.py
  72. +2 −25 testsuite/spline-nonuniformknots/run.py
  73. +1 −23 testsuite/spline/run.py
  74. +1 −25 testsuite/splineinverse/run.py
  75. +1 −25 testsuite/string/run.py
  76. +1 −25 testsuite/struct-array-mixture/run.py
  77. +1 −25 testsuite/struct-array/run.py
  78. +3 −24 testsuite/struct-err/run.py
  79. +1 −26 testsuite/struct-layers/run.py
  80. +1 −25 testsuite/struct-with-array/run.py
  81. +1 −25 testsuite/struct-within-struct/run.py
  82. +1 −25 testsuite/struct/run.py
  83. +1 −25 testsuite/ternary/run.py
  84. +1 −24 testsuite/texture-alpha/run.py
  85. +1 −24 testsuite/texture-blur/run.py
  86. +1 −24 testsuite/texture-field3d/run.py
  87. +1 −24 testsuite/texture-firstchannel/run.py
  88. +1 −24 testsuite/texture-interp/run.py
  89. +1 −24 testsuite/texture-simple/run.py
  90. +1 −24 testsuite/texture-width/run.py
  91. +1 −24 testsuite/texture-withderivs/run.py
  92. +1 −23 testsuite/texture-wrap/run.py
  93. +1 −25 testsuite/transform/run.py
  94. +1 −25 testsuite/transformc/run.py
  95. +1 −25 testsuite/trig/run.py
  96. +1 −25 testsuite/typecast/run.py
  97. +1 −25 testsuite/vecctr/run.py
  98. +1 −25 testsuite/vector/run.py
  99. +3 −0 testsuite/wavelength_color/ref/out.txt
  100. +2 −25 testsuite/wavelength_color/run.py
  101. +1 −0 testsuite/xml/ref/out.txt
  102. +1 −25 testsuite/xml/run.py
@@ -1,14 +1,6 @@
dist
build
*.aux
*.adx
*.ind
*.log
*.out
*.toc
*.idx
*.ilg
*~
\#*\#
*.pyc
testsuite/*/*.oso
*.log
@@ -40,6 +40,7 @@ endif

ifneq (${VERBOSE},)
MY_MAKE_FLAGS += VERBOSE=${VERBOSE}
TEST_FLAGS += -V
endif

ifneq (${USE_TBB},)
@@ -69,6 +70,10 @@ ifneq (${MYCXX},)
MY_CMAKE_FLAGS += -DCMAKE_CXX_COMPILER:STRING=${MYCXX}
endif

ifneq (${TEST},)
TEST_FLAGS += -R ${TEST}
endif

#$(info MY_CMAKE_FLAGS = ${MY_CMAKE_FLAGS})
#$(info MY_MAKE_FLAGS = ${MY_MAKE_FLAGS})

@@ -127,8 +132,15 @@ cmakeinstall: cmake
dist : cmakeinstall

# 'make test' does a full build and then runs all tests
test: cmakeinstall
( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} test )
test: cmake
cmake -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests ${TEST_FLAGS}..."
( cd ${build_dir} ; ctest --force-new-ctest-process ${TEST_FLAGS} -E broken )

# 'make testall' does a full build and then runs all tests (even the ones
# that are expected to fail on some platforms)
testall: cmake
cmake -E cmake_echo_color --switch=$(COLOR) --cyan "Running all tests ${TEST_FLAGS}..."
( cd ${build_dir} ; ctest --force-new-ctest-process ${TEST_FLAGS} )

# 'make package' builds everything and then makes an installable package
# (platform dependent -- may be .tar.gz, .sh, .dmg, .rpm, .deb. .exe)
@@ -157,14 +169,6 @@ nuke:
doxygen:
doxygen src/doc/Doxyfile

#testclean : ${all_tests}
# @ for f in ${all_tests} ; do \
# ( cd $$f ; \
# echo "Cleaning test $$f " ; \
# ./run.py -c ; \
# ) \
# done

#########################################################################


@@ -181,7 +185,8 @@ help:
@echo " make clean Remove the temporary files in ${build_dir}"
@echo " make realclean Remove both ${build_dir} AND ${dist_dir}"
@echo " make nuke Remove ALL of build and dist (not just ${platform})"
@echo " make test Run all tests"
@echo " make test Run tests"
@echo " make testall Run all tests, even broken ones"
@echo " make doxygen Build the Doxygen docs in ${top_build_dir}/doxygen"
@echo ""
@echo "Helpful modifiers:"
@@ -89,9 +89,6 @@ include_directories (
)


# We want CTest for testing
include (CTest)

include_directories ("include")

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -143,13 +140,46 @@ add_subdirectory (doc)
#########################################################################
# Testing

# We want CTest for testing
include (CTest)

# Make a copy of the testsuite into the build area
if (DEFINED CMAKE_VERSION AND NOT CMAKE_VERSION VERSION_LESS 2.8)
file (COPY ${PROJECT_SOURCE_DIR}/../testsuite
DESTINATION ${CMAKE_BINARY_DIR})
endif()

macro ( TESTSUITE )
foreach (_testname ${ARGN})
parse_arguments (_ats "LABEL" "" ${ARGN})
# If there was a FOUNDVAR param specified and that variable name is
# not defined, mark the test as broken.
if (_ats_FOUNDVAR AND NOT ${_ats_FOUNDVAR})
set (_ats_LABEL "broken")
endif ()
# Add the tests if all is well.
foreach (_testname ${_ats_DEFAULT_ARGS})
set (_testdir "${CMAKE_BINARY_DIR}/testsuite/${_testname}")
if (_ats_LABEL MATCHES "broken")
set (_testname "${_testname}-broken")
endif ()
set (_runtest python ${CMAKE_BINARY_DIR}/testsuite/runtest.py
${_testdir} ${_extra_test_args})
if (MSVC_IDE)
set (_runtest ${_runtest} --devenv-config $<CONFIGURATION>
--solution-path "${CMAKE_BINARY_DIR}" )
endif ()

message (STATUS "TEST ${_testname}: ${CMAKE_BINARY_DIR}/testsuite/runtest.py ${_testdir} ${_extra_test_args}")

# Run the test unoptimized
add_test ( ${_testname} env OPENIMAGEIOHOME=${OPENIMAGEIOHOME} TESTSHADE_OPT=0 python ${PROJECT_SOURCE_DIR}/../testsuite/${_testname}/run.py ${PROJECT_SOURCE_DIR}/../testsuite/${_testname} ${CMAKE_BINARY_DIR} )
set (_env TESTSHADE_OPT=0 OPENIMAGEIOHOME=${OPENIMAGEIOHOME})
add_test ( NAME ${_testname}
COMMAND env ${_env} ${_runtest} )
# Run the same test again with aggressive -O2 runtime
# optimization, triggered by setting TESTSHADE_OPT env variable
add_test ( ${_testname}.opt env OPENIMAGEIOHOME=${OPENIMAGEIOHOME} TESTSHADE_OPT=2 python ${PROJECT_SOURCE_DIR}/../testsuite/${_testname}/run.py ${PROJECT_SOURCE_DIR}/../testsuite/${_testname} ${CMAKE_BINARY_DIR} )
set (_env TESTSHADE_OPT=2 OPENIMAGEIOHOME=${OPENIMAGEIOHOME})
add_test ( NAME ${_testname}.opt
COMMAND env ${_env} ${_runtest} )
endforeach ()
endmacro ()

This file was deleted.

This file was deleted.

@@ -21,13 +21,6 @@ IF (OPENIMAGEIO_INCLUDES AND OPENIMAGEIO_LIBRARY )
SET ( OPENIMAGEIO_FOUND TRUE )
MESSAGE ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDES}" )
MESSAGE ( STATUS "OpenImageIO library = ${OPENIMAGEIO_LIBRARY}" )
MESSAGE ( STATUS "OpenImageIO namespace = ${OPENIMAGEIO_NAMESPACE}" )
if (OPENIMAGEIO_NAMESPACE)
add_definitions ("-DOPENIMAGEIO_NAMESPACE=${OPENIMAGEIO_NAMESPACE}")
endif ()
# N.B. -- once we're confident that we only build against OIIO >= 0.9.x,
# specifically versions after we did the big namespace change, then we
# can completely eliminate the 'OPENIMAGEIO_NAMESPACE' parts above.
ELSE ()
MESSAGE ( STATUS "OpenImageIO not found" )
ENDIF ()
@@ -0,0 +1,8 @@
*.aux
*.adx
*.ind
*.log
*.out
*.toc
*.idx
*.ilg
@@ -1,27 +1,3 @@
#!/usr/bin/python

import os
import sys

path = ""
command = ""
if len(sys.argv) > 2 :
os.chdir (sys.argv[1])
path = sys.argv[2] + "/"

# A command to run
command = path + "oslc/oslc test.osl > out.txt"
command = command + "; " + path + "testshade/testshade -g 2 2 test >> out.txt"

# Outputs to check against references
outputs = [ "out.txt" ]

# Files that need to be cleaned up, IN ADDITION to outputs
cleanfiles = [ ]


# boilerplate
sys.path = [".."] + sys.path
import runtest
ret = runtest.runtest (command, outputs, cleanfiles)
sys.exit (ret)
command = testshade("-g 2 2 test")
@@ -1,27 +1,3 @@
#!/usr/bin/python

import os
import sys

path = ""
command = ""
if len(sys.argv) > 2 :
os.chdir (sys.argv[1])
path = sys.argv[2] + "/"

# A command to run
command = path + "oslc/oslc test.osl > out.txt"
command = command + "; " + path + "testshade/testshade -g 2 2 test >> out.txt"

# Outputs to check against references
outputs = [ "out.txt" ]

# Files that need to be cleaned up, IN ADDITION to outputs
cleanfiles = [ ]


# boilerplate
sys.path = [".."] + sys.path
import runtest
ret = runtest.runtest (command, outputs, cleanfiles)
sys.exit (ret)
command = testshade("-g 2 2 test")
@@ -1,28 +1,3 @@
#!/usr/bin/python

import os
import sys

path = ""
command = ""
if len(sys.argv) > 2 :
os.chdir (sys.argv[1])
path = sys.argv[2] + "/"

# A command to run
command = path + "oslc/oslc test.osl > out1.txt"
command = command + "; " + path + "testshade/testshade test >& out2.txt"
command = command + "; cat out1.txt out2.txt > out.txt"

# Outputs to check against references
outputs = [ "out.txt" ]

# Files that need to be cleaned up, IN ADDITION to outputs
cleanfiles = [ ]


# boilerplate
sys.path = [".."] + sys.path
import runtest
ret = runtest.runtest (command, outputs, cleanfiles)
sys.exit (ret)
command = testshade("test")
@@ -1,27 +1,3 @@
#!/usr/bin/python

import os
import sys

path = ""
command = ""
if len(sys.argv) > 2 :
os.chdir (sys.argv[1])
path = sys.argv[2] + "/"

# A command to run
command = path + "oslc/oslc test.osl > out.txt"
command = command + "; " + path + "testshade/testshade -g 2 2 test >> out.txt"

# Outputs to check against references
outputs = [ "out.txt" ]

# Files that need to be cleaned up, IN ADDITION to outputs
cleanfiles = [ ]


# boilerplate
sys.path = [".."] + sys.path
import runtest
ret = runtest.runtest (command, outputs, cleanfiles)
sys.exit (ret)
command = testshade("-g 2 2 test")

0 comments on commit fc7b1a5

Please sign in to comment.
You can’t perform that action at this time.