forked from degauden/Elements
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUnrecognizedOption_test
More file actions
executable file
·78 lines (65 loc) · 1.9 KB
/
Copy pathUnrecognizedOption_test
File metadata and controls
executable file
·78 lines (65 loc) · 1.9 KB
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
#!/bin/sh
#
# Copyright (C) 2012-2020 Euclid Science Ground Segment
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 3.0 of the License, or (at your option)
# any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
home_dir=${PWD}
# Create unique directory
tmploc=$(mktemp -dq -t temp.XXXXXX)
# Clean and exit
local_clean_exit() {
cd ${home_dir}
rm -rf ${tmploc}
exit $1
}
cd ${tmploc} || local_clean_exit 1
# regular run
CppProgramExample
if [ $? -ne 0 ]; then
echo "Error: <CppProgramExample> failed" 1>&2
local_clean_exit 1
fi
# regular run with known option
CppProgramExample -f
if [ $? -ne 0 ]; then
echo "Error: <CppProgramExample -f> failed" 1>&2
local_clean_exit 1
fi
# regular run with unknown option
CppProgramExample --toto
if [ $? -ne 64 ]; then
echo "Error: <CppProgramExample --toto> succeeded" 1>&2
local_clean_exit 1
fi
# regular run
PythonProgramExample
if [ $? -ne 0 ]; then
echo "Error: <PythonProgramExample> failed" 1>&2
local_clean_exit 1
fi
# regular run with known option
PythonProgramExample --overwrite
if [ $? -ne 0 ]; then
echo "Error: <PythonProgramExample --overwrite> failed" 1>&2
local_clean_exit 1
fi
# regular run with unknown option
PythonProgramExample --toto
if [ $? -eq 0 ]; then
echo "Error: <PythonProgramExample --toto> succeeded" 1>&2
local_clean_exit 1
fi
local_clean_exit 0