Adding tests to regression test library

This commit is contained in:
Michael Tryby
2018-03-22 16:34:24 -04:00
parent 63b4438765
commit 1cf806206c
18 changed files with 1693 additions and 0 deletions

46
tools/app-config.sh Normal file
View File

@@ -0,0 +1,46 @@
#! /bin/bash
#
# app-config.sh - Generates nrtest app configuration file for test executable
#
# Date Created: 3/19/2018
#
# Author: Michael E. Tryby
# US EPA - ORD/NRMRL
#
# Arguments:
# 1 - absolute path to test executable
#
# NOT IMPLEMENTED YET
# 2 - test executable version number
# 3 - build description
#
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) ;&
Darwin*) abs_build_path=$1
test_cmd="runepanet"
;;
MINGW*) ;&
MSYS*) # Remove leading '/c' from file path for nrtest
abs_build_path="$( echo "$1" | sed -e 's#/c##' )"
test_cmd="runepanet.exe"
;;
*) # Machine unknown
esac
version=""
build_description=""
cat<<EOF
{
"name" : "epanet",
"version" : "${version}",
"description" : "${build_description}",
"setup_script" : "",
"exe" : "${abs_build_path}/${test_cmd}"
}
EOF

43
tools/test-config.sh Normal file
View File

@@ -0,0 +1,43 @@
#! /bin/bash
#
# test-config.sh - Generates nrtest test configuration file for test case.
#
# Date Created: 3/19/2018
#
# Author: Michael E. Tryby
# US EPA - ORD/NRMRL
#
# Arguments:
# 1 - name
# 2 - version
# 3 - description
#
# Suggested Usage:
# $ for file in .//*; do ./test-config.sh $file 1.0 > "${file%.*}.json"; done
#
filename="$1"
name="${filename%.*}"
version="$2"
description="$3"
cat<<EOF
{
"name": "${name}",
"version": "${version}",
"description": "${description}",
"args": [
"${name}.inp",
"${name}.rpt",
"${name}.out"
],
"input_files": [
"${name}.inp"
],
"output_files": {
"${name}.rpt": "epanet report",
"${name}.out": "epanet allclose"
}
}
EOF