All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
icaruscode/test/ci/compileGalleryAnalysis.sh
Go to the documentation of this file.
1 #!/usr/bin/env bash
2 #
3 # Purpose: exercise compilation of gallery in a compatible environment.
4 # This script will return a non-zero exit code on compilation error.
5 #
6 
7 # the first simple command exiting with an error will cause the shell to exit;
8 # sometimes this interferes with the commands (e.g. `setup`); in that case,
9 # some trick is needed.
10 set -e
11 
12 declare -r CWD="$(pwd)"
13 declare -r WorkDir="${CWD}/galleryTest"
14 
15 #
16 # create a working area
17 #
18 declare -r SourceDir="${WorkDir}/source"
19 declare -r BuildDir="${WorkDir}/build"
20 
21 declare -r ICARUSgalleryBaseDir="${ICARUSCODE_DIR}/examples/gallery"
22 
23 rm -Rf "$WorkDir"
24 mkdir "$WorkDir"
25 cd "$WorkDir"
26 
27 cp -a "${ICARUSgalleryBaseDir}/galleryAnalysis" "$SourceDir"
28 
29 rm -Rf "$BuildDir"
30 mkdir "$BuildDir"
31 
32 #
33 # set up
34 #
35 # set up some UPS version of CMake only if none is set up already:
36 [[ -n "$CMAKE_DIR" ]] || source "$(ups setup cmake 'v3_10_1')"
37 
38 #
39 # proceed with compilation
40 #
41 cd "$BuildDir"
42 cmake "$SourceDir"
43 make
44 
CWD
Definition: fcl_checks.sh:13
do source
process_name gaushit a
do cd
do i e
esac echo uname r