forked from NHERI-SimCenter/R2DTool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RunTests.sh
executable file
·130 lines (91 loc) · 2.24 KB
/
RunTests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
# Script to run R2D Unit Tests
# Created by Stevan Gavrilovic
BASEDIR=$(dirname "$0")
cd $BASEDIR
echo "Script file is in directory " $PWD
cd build
# Run qmake for Tests
qmake ../Tests/R2DTests.pri
status=$?
if [[ $status != 0 ]]
then
echo "R2D Tests: qmake failed";
exit $status;
fi
# make
make -j8
status=$?;
if [[ $status != 0 ]]
then
echo "R2D Tests: make failed";
exit $status;
fi
cd ..
# Copy over the dependencies for the test app
mkdir Frameworks
cp -Rf ../QGISPlugin/mac/qgis-deps-0.9/stage/lib/* Frameworks/
cp -Rf ../QGISPlugin/mac/Install/lib/* Frameworks/
# Copy over the examples folder
mkdir ./build/Examples
cp -Rf ../R2DExamples/* ./build/Examples/
# Copy over the applications dir
cp -Rf ../SimCenterBackendApplications/applications build/
status=$?;
if [[ $status != 0 ]]
then
echo "Error copying the applications";
exit $status;
fi
# Download dakota and opensees, extract them, and install them to the build/applications folder
mkdir dakota
cd dakota
curl -O https://dakota.sandia.gov/sites/default/files/distributions/public/dakota-6.15.0-public-darwin.Darwin.x86_64-cli.tar.gz
tar -xf *.tar.gz
cd ..
mkdir ./build/applications/dakota
status=$?;
if [[ $status != 0 ]]
then
echo "Error making the dakota dir";
exit $status;
fi
cp -rf ./dakota/dakota-*/* ./build/applications/dakota
status=$?;
if [[ $status != 0 ]]
then
echo "Error copying dakota to build/applications/dakota dir";
exit $status;
fi
mkdir opensees
cd opensees
curl -O https://opensees.berkeley.edu/OpenSees/code/OpenSees3.3.0Mac.tar.gz
tar -xf *.tar.gz
cd ..
mkdir ./build/applications/opensees
status=$?;
if [[ $status != 0 ]]
then
echo "Error making the build/applications/opensees dir";
exit $status;
fi
cp -rf ./opensees/OpenSees*/* ./build/applications/opensees
status=$?;
if [[ $status != 0 ]]
then
echo "Error copying opensees to applications dir";
exit $status;
fi
# Install nheri-sincenter python repositories
python3 -m pip install nheri-simcenter
# Disable gatekeeper because dakota is unsigned
sudo spctl --master-disable
# Run the test app
./build/R2DTest
status=$?
if [[ $status != 0 ]]
then
echo "R2D: unit tests failed";
exit $status;
fi
echo "All R2D Unit Tests Passed!"