Difference between revisions of "UCVM Testing"

From SCECpedia
Jump to navigationJump to search
Line 135: Line 135:
 
* accept_test.py:def test_vs30_query(dir):
 
* accept_test.py:def test_vs30_query(dir):
 
* accept_test.py:def test_ssh_generate(dir):
 
* accept_test.py:def test_ssh_generate(dir):
 
== Model Tests ==
 
Each velocity model has tests showing expected results for some points
 
* Test Cases 1D Models
 
* Test Cases CVM S4.26
 
* Test Cases CVM-H
 
* Test Cases External CVMs
 
* Test Cases Invalid Points
 
  
 
== Locate and Describe These Utilities Tests ==
 
== Locate and Describe These Utilities Tests ==

Revision as of 04:26, 8 September 2021

UCVM C-Language Testing Fixtures

  • C-Language - unittest - C executable
  • accepttest - C executable

UCVM uses two C language programs called unittest.c and accepttest.c framework. These C program framework provides methods like "test_assert_string()". There are references to an xmldir with list of tests, but that is not used. These C language tests enable us to test the C-API for UCVM

Test defined as C lanuage functions in accepttest_suite_grid.c

    • test_grid_tool_1d()
    • test_grid_lib_1d()
    • then suite_xxx() where test_grid_tool_1d is tested with its own script

UCVM Python Language Testing

UCVM uses a custom script accept_test.py. Contains two tests:

    • def test_vs30_query(dir)
    • def test_ssh_generate(dir):

UCVM Test Scripts

  • make check - defined in ucvm_bin/tests
    • runs unittest
    • runs accepttest
    • runs accept_test.py
  • Makefile.am creates script > run-testing
    • unittest
    • accepttest
    • accept_test.py
    • cd api; ./run_query_1d_gtl.sh
    • cd basin; ./run_basin_query_mpi_cvms5.sh
    • cd mesh; ./run_ucvm2mesh_mpi_layer_cvms.sh

Manifest of UCVM Programs and Scripts Requiring Tests

Programs in UCVM bin directory:

  1. ssh_generate
  2. ssh_merge
  3. vs30_query
  4. vs30_query_mpi
  5. basin_query
  6. basin_query_mpi
  7. basin_query_mpi_complete
  8. ecoalesce
  9. ecompact
  10. grd2etree
  11. grd_query
  12. mesh_check
  13. mesh_op
  14. mesh_strip_ijk
  15. patchmodel
  16. ucvm2mesh
  17. ucvm2mesh_mpi
  18. ucvm2mesh_mpi_layer
  19. ucvm2etree
  20. ucvm2etree_extract_MPI
  21. ucvm2etree_merge_MPI
  22. ucvm2etree_sort_MPI
  23. ucvm_query

Programs in Utilities Directory:

  1. installed_models.py
  2. makegrid.sh
  3. run_ucvm_query.sh
  4. run_ucvm.sh
  5. time_mesh_generation.py
  6. view_png.py

Test programs:

  1. unittest
  2. accepttest
  3. accept_test.py
  4. api/query_1d_gtl
  5. api/run_query_1d_gtl.sh
  6. basin/run_basin_query_mpi_cvms5.sh -> tests basin_query_mpi
  7. mesh/ucvm2mesh_mpi_layer
  8. mesh/run_ucvm2mesh_mpi_layer_cvms.sh

Programs in UCVM Source Distribution

The programs listed above are found in the ucvm_bin/ installation directory. The UCVM installation process includes a source code directory with numerous example programs not included in the bin installation. A list of programs in the UCVM Source directory is given here:

UCVM Plotting routines have been moved into a separate repo. Information on the plotting routines.

Core UCVM C-language tests - Unittests

Tests for adding Models to UCVM. These also confirm path to UCVM models set correctly. Test defined as c language functions in unittest_suite_lib.c. This c-language program imports ucvm.h and then calls the UCVM API from C language program. The inputs and expected results for several of the tests are hard-coded in the C source code files.

    • test_lib_init()
    • test_lib_add_model_1d()
    • test_lib_query_1d()
    • test_lib_get_model_label_1d()
    • test_lib_setparam_querymode_gd_1d()
    • test_lib_setparam_querymode_ge_1d
    • test_lib_model_version_1d

Following Tests have conditional compile statements in unittest.c

    • test_lib_add_model_cencal
    • test_lib_add_model_cvmh
    • test_lib_add_model_cvms
    • test_lib_add_model_cvmsi
    • test_lib_add_model_ivlsu
    • test_lib_add_model_cvlsu
    • test_lib_add_model_albacore
    • test_lib_add_model_cvms5
    • test_lib_add_model_cca
    • test_lib_add_model_cs173
    • test_lib_add_model_cs173h

Tests for Query by Elevation/Query by Depth

  • int test_lib_setparam_querymode_gd_1d()
  • int test_lib_setparam_querymode_ge_1d()

Core Capabilities Requiring Tests

Additional Key Core Functionality

  • Test case interpolation
  • Test Cases Tiling
  • Test Cases Invalid Point

Tests for C executables of basic query interface

  • ucvm_query
  • basin_query

Programs Requiring Integration Tests

Meshing Commands and scripts - Referenced but not found

  • run_grd.sh
  • test_grid
  • test_ucvm
  • ehelper
  • grd
  • vs30_query_debug
  • work/make_manifest.py

These tests need to be migrated to unittest_suite_lib.c

  • Adding Elygtl:ifunc
  • accepttest_suite_grid.c:int test_grid_tool_1d()
  • accepttest_suite_grid.c:int test_grid_lib_1d()

These tests need to be migrated to standard python test framework

  • accept_test.py:def test_vs30_query(dir):
  • accept_test.py:def test_ssh_generate(dir):

Locate and Describe These Utilities Tests

  • programs/ucvm/run_ucvm_query_albacore.sh
  • programs/ucvm/run_ucvm_query_cvmh.sh
  • programs/ucvm/run_ucvm_query_wfcvm.sh

Related Entries