Commit 509eaf29 authored by Ben Boeckel's avatar Ben Boeckel

Merge topic 'smtk-temp-dir'

* smtk-temp-dir:
  Use Testing/Temporary for temporary disk space.

Merge-request: !348
parents c0d088b9 8c910830
......@@ -17,6 +17,7 @@ endforeach()
if (SMTK_DATA_DIR AND EXISTS ${SMTK_DATA_DIR}/cmb-testing-data.marker)
foreach (test ${smtkDiscreteSessionPythonDataTests})
smtk_add_test_python(${test}Py ${test}.py
--data-dir=${SMTK_DATA_DIR})
--data-dir=${SMTK_DATA_DIR}
--temp-dir=${CMAKE_BINARY_DIR}/Testing/Temporary)
endforeach()
endif()
......@@ -98,9 +98,11 @@ class TestDiscreteCreateEdges(smtk.testing.TestCase):
self.verifyCreateEdges(test['filename'], test['validator'])
if self.shouldSave:
out = file('testcreateedges.json', 'w')
ftmp = os.path.join(smtk.testing.TEMP_DIR,'testcreateedges.json')
out = file(ftmp, 'w')
print >>out, smtk.io.ExportJSON.fromModelManager(self.mgr)
out.close()
os.remove(ftmp)
if __name__ == '__main__':
smtk.testing.process_arguments()
......
......@@ -22,12 +22,13 @@ if (SMTK_ENABLE_EXODUS_SESSION AND SMTK_ENABLE_DISCRETE_SESSION AND SMTK_ENABLE_
endif()
foreach (test ${smtkModelPythonTests})
smtk_add_test_python(${test}Py ${test}.py)
smtk_add_test_python(${test}Py ${test}.py --temp-dir=${CMAKE_BINARY_DIR}/Testing/Temporary)
endforeach()
if (SMTK_DATA_DIR AND EXISTS ${SMTK_DATA_DIR}/cmb-testing-data.marker)
foreach (test ${smtkModelPythonDataTests})
smtk_add_test_python(${test}Py ${test}.py
--data-dir=${SMTK_DATA_DIR})
--data-dir=${SMTK_DATA_DIR}
--temp-dir=${CMAKE_BINARY_DIR}/Testing/Temporary)
endforeach()
endif()
......@@ -17,7 +17,7 @@ if smtk.wrappingProtocol() == 'pybind11':
from smtk.simple import *
import smtk.testing
import sys
import tempfile
import uuid
class TestExportImport(smtk.testing.TestCase):
......@@ -51,8 +51,7 @@ class TestExportImport(smtk.testing.TestCase):
self.assertGreater(numModels, 0, 'Must read at least one model to test.')
# Export and then import
# Generate a temporary filename
ftmp = os.path.join(tempfile.mkdtemp(), 'test.json')
ftmp = os.path.join(smtk.testing.TEMP_DIR, str(uuid.uuid4()) + '.json')
# Export to ftmp
exp = sess.op('export smtk model')
SetVectorValue(exp.findFile('filename', smtk.attribute.ACTIVE_CHILDREN), [ftmp,])
......@@ -90,6 +89,8 @@ class TestExportImport(smtk.testing.TestCase):
self.assertImageMatchIfFileExists(kwargs['baseline'])
self.interact()
os.remove(ftmp)
def testImportExport(self):
sequence = [ \
{'sessionType':'exodus', 'filename':smtk.testing.find_data(['model', '3d', 'netcdf', 'pillbox.ncdf']), 'modelChecker':self.checkPillbox}, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment