All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
testFHiCLfiles_sbnd.sh
Go to the documentation of this file.
1 #!/usr/bin/env bash
2 
3 SCRIPTDIR="$(dirname "$0")"
4 
5 #
6 # platform compatibility test
7 #
8 if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then
9  echo "This test script requires BASH 4.0 or newer." >&2
10  exit # the test is declared a success
11 fi
12 
13 #
14 # find the actual test script
15 # currently located alongside this file
16 #
17 declare -r TestScriptName='testFHiCLfiles.sh'
18 declare TestScript
19 TestScript="$(which "$TestScriptName" 2> /dev/null)"
20 [[ $? != 0 ]] && TestScript="${SCRIPTDIR}/${TestScriptName}"
21 [[ -r "$TestScript" ]] || TestScript="./${TestScriptName}"
22 
23 if [[ ! -r "$TestScript" ]]; then
24  echo "FATAL: test script '${TestScriptName}' not found!" >&2
25  exit 2
26 fi
27 
28 #
29 # decide what to test
30 #
31 declare -a TestDirs
32 
33 if [[ -n "$SBNDCODE_DIR" ]]; then
34  DistributedFHiCLdir="${SBNDCODE_DIR}/fcl"
35  if [[ -d "$DistributedFHiCLdir" ]]; then
36  echo "Will test the distributed job configuration directory '${DistributedFHiCLdir}'"
37  TestDirs+=( "$DistributedFHiCLdir" )
38  fi
39 fi
40 
41 if [[ -n "$MRB_BUILDDIR" ]]; then
42  InstalledFHiCLdir="${MRB_BUILDDIR}/sbndcode/fcl"
43  if [[ -d "$InstalledFHiCLdir" ]]; then
44  echo "Will test the installed job configuration directory in MRB build area ('${InstalledFHiCLdir}')"
45  TestDirs+=( "$InstalledFHiCLdir" )
46  fi
47 fi
48 
49 if [[ -n "$MRB_SOURCE" ]]; then
50  SourceFHiCLdir="${MRB_SOURCE}/sbndcode/sbndcode/JobConfigurations"
51  if [[ -d "$SourceFHiCLdir" ]]; then
52  echo "Will test the job configuration directory in MRB source area ('${SourceFHiCLdir}')"
53  TestDirs+=( "$SourceFHiCLdir" )
54  fi
55 fi
56 
57 if [[ "${#TestDirs[@]}]" == 0 ]]; then
58  echo "FATAL: no suitable FHiCL directory found to be tested!" >&2
59  exit 1
60 fi
61 
62 #
63 # run the test
64 #
65 "$SHELL" "$TestScript" "$@" "${TestDirs[@]}"
66 
#define the
process_name gaushit a
then shift fi
BEGIN_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree showermakertwo END_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree sequence::inline_paths sequence::inline_paths sequence::inline_paths showermakers test
then echo This test script requires BASH or newer &exit fi declare r TestScriptName
esac echo uname r
then DistributedFHiCLdir