Giter VIP home page Giter VIP logo

gcongiu / testsuite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from e4s-project/testsuite

0.0 1.0 0.0 38.33 MB

E4S test suite with validation tests

License: MIT License

Shell 0.27% C++ 4.34% Python 0.14% C 19.14% Fortran 74.85% Awk 0.01% Pascal 0.01% TeX 0.10% Objective-C++ 0.38% SourcePawn 0.01% Cuda 0.03% Makefile 0.34% Cap'n Proto 0.01% CMake 0.41% GLSL 0.01% Batchfile 0.01% Roff 0.01% Modula-3 0.01% SWIG 0.01% NASL 0.01%

testsuite's Introduction

testsuite

E4S test suite with validation tests

Getting Started

  1. Clone E4S Testsuite
git clone https://github.com/E4S-Project/testsuite
  1. Source your spack environment
source /path/to/spack/share/spack/setup-env.sh
  1. Check settings.sh. By default the testsuite will get its compile and run commands from settings.sh in the top level testsuite directory. You can smylink this file to one of the settings preset files or indicate a file with an argument to test-all.sh.

To run all the test run

./test-all.sh

The output builds and logs will be in the test directories.

The return value of test-all.sh is the number of failures encountered (0 for complete success).

Alternately you can run a subset of tests by specifying a directory path in validation_tests for instance if you want to run the qthreads test run

./test-all.sh ./validation_tests/qthreads

Test subsets may be created by symlinking selected test directories from validation_tests to a new directory.

After the optional test directory argument test-all.sh accepts to additional optional arguments:

--json

will cause the test output to be written in json format. Redirect to a file for post-processing.

--settings <file>

allows you to specify a settings file that provides the compile and run commands to be used by the testsuite. By default the file named settings.sh will be used. This can be symlinked to provided sample settings failes.

Variables that can be set in the settings file:

  • TEST_CC_MPI: MPI C compiler command
  • TEST_CXX_MPI: MPI C++ compiler command
  • TEST_FTN_MPI: MPI Fortran compiler command
  • TEST_CC: C compiler command
  • TEST_CXX: C++ compiler command
  • TEST_FTN: Fortran compiler command
  • TEST_RUN_CMD: MPI run command
  • TEST_RUN_PROCFLAG: flag to indicate number of processes to MPI
  • TEST_RUN_PROCARG: number of MPI processes to run
  • TEST_RUN: Combined full mpi invocation including number of processes
  • TESTSUITE_VARIANT: Variant that will be applied to every spack package search when setting up test environments. Useful when spack packages are built with multiple compilers. Optional.
  • Any global environment variable to be applied to every test.

These can be used in combination within test build and run scripts to make sure consistent sane defaults for runs on a given system. Specific tests can override these values if needed (e.g. a test that is hard coded to run ona certain number of MPI processes.

--print-logs

Print contents of all clean/compiler/run logs to screen as the tests complete

--color-off

Disable printing test results in color

Creating Tests

Create a new test by placing a directory in the validation_tests directory. The directory name should be descriptive of the test. The name of the spack package being tested is a reasonable default.

The actual test code and build files should be set up to work with includes and libraries provided by spack. To simplify this process we provide environment variables that can be referenced to get the locations of these resources.

In addition to any build, code and data files the test directory should generally contain four scripts:

setup.sh

This sets up the environment for the clean/compile/run operations. A basic setup.sh script will look like:

#!/bin/bash
. ../../setup.sh  #The top level
spackLoadUnique <package name>

spackLoadUnique is made available by sourcing the top level setup.sh script. This command loads a single version of the spack package specified along with all of its dependencies. It also sets environment variables that are useful for building/running with your package. <PACKAGE NAME>_ROOT will provide the install location of the package loaded by spack. <PACKAGE_NAME>_LIB_PATH gives the full path of the library directory in the package installation. This is useful since there can be ambiguity between the use of lib and lib64 directories for certain packages. Multiple spackLoadUnique calls can be run if needed. Other environment variables can also be set here.

clean.sh

This cleans the test directory. A basic clean.sh script will look like:

#!/bin/bash
. ./setup.sh
make distclean

This assumes the test uses a makefile with a distclean target. Executing make clean or manually running rm on generated build or output files and directories is also possible. Sourcing the local setup.sh may be optional if the clean operation doesn't depend on having the package loaded.

compile.sh

The compile scripts builds the test. In the case of a test that builds with a simple call to make the script might look like:

#!/bin/bash -e
. ./setup.sh
set -x
make 

Using -e is recommended to cause the script to exit at the first failure. Setting -x is helpful in getting verbose output from internal scripts. Depending on the nature of your test this script might also sett build specific environment variables, directly invoke compiler commands, create and cd to a build directory and invoke cmake.

This script could potentially iterate through multiple build directories to create more than one executable. This script may be optional if no build is necessary, as may be the case for some python packages.

run.sh

Runs the executables created for the test. A simple run script might look like:

#!/bin/bash -e
. ./setup.sh
set -x
eval $TEST_RUN ./<executable> #Using the TEST_RUN variable provided by settings.sh to run with MPI
./<executable> #Running a non-mpi invocation of an executable

This script could potentially iterate through the execution of multiple executables.

testsuite's People

Contributors

wspear avatar coti avatar eugeneswalker avatar frederickdeny avatar spoutn1k avatar sameershende avatar scottkwarren avatar platinumcd avatar khuck avatar sambosch77 avatar vicentebolea avatar dhrogers avatar liuyangzhuan avatar pghysels avatar mkstoyanov avatar cyrush avatar mathstuf avatar bonachea avatar egreen77 avatar abouteiller avatar brugger1 avatar jwillenbring avatar calccrypto avatar msimberg avatar streeve avatar shahzebsiddiqui avatar blue42u avatar etpalmer63 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.