@@ -133,95 +133,6 @@ function test_gdb()
133133 fi
134134
135135 (
136- case " ${suffix} " in
137- ' ' )
138- ;;
139-
140- -py)
141- local python_name
142- if [ " ${node_platform} " == " win32" ]
143- then
144- python_name=" python"
145- else
146- python_name=" python2.7"
147- fi
148-
149- echo
150- echo " Identifying Python 2..."
151-
152- local which_python
153- set +e
154- which_python=" $( which ${python_name} 2> /dev/null) "
155- if [ -z " ${which_python} " ]
156- then
157- echo
158- echo " >>> No ${python_name} installed, skipping gdb_py test."
159- return
160- fi
161- set -e
162-
163- echo " Found as ${which_python} ."
164-
165- echo
166- ${python_name} --version
167-
168- export PYTHONHOME=" $( ${python_name} -c ' import sys; print(sys.prefix)' ) "
169- export PYTHONPATH=" $( ${python_name} -c ' import sys; import os; print(os.pathsep.join(sys.path))' ) "
170- echo " PYTHONHOME=${PYTHONHOME} "
171- echo " PYTHONPATH=${PYTHONPATH} "
172- ;;
173-
174- -py3)
175- local python_name
176- if [ " ${node_platform} " == " win32" ]
177- then
178- if [ -f " /c/Python38/python.exe" ]
179- then
180- export PATH=" /c/Python38:$PATH "
181- elif [ -f " /c/Python37/python.exe" ]
182- then
183- export PATH=" /c/Python37:$PATH "
184- fi
185-
186- python_name=" python"
187- elif [ " ${node_platform} " == " linux" ]
188- then
189- python_name=" python3.7"
190- elif [ " ${node_platform} " == " darwin" ]
191- then
192- python_name=" python3.7"
193- fi
194-
195- echo
196- echo " Identifying Python 3..."
197-
198- set +e
199- local which_python
200- which_python=" $( which ${python_name} 2> /dev/null) "
201- if [ -z " ${which_python} " ]
202- then
203- echo
204- echo " >>> No ${python_name} installed, skipping gdb_py3 test."
205- return
206- fi
207- set -e
208- echo " Found as ${which_python} ."
209-
210- echo
211- ${python_name} --version
212-
213- export PYTHONHOME=" $( ${python_name} -c ' import sys; print(sys.prefix)' ) "
214- export PYTHONPATH=" $( ${python_name} -c ' import sys; import os; print(os.pathsep.join(sys.path))' ) "
215- echo " PYTHONHOME=${PYTHONHOME} "
216- echo " PYTHONPATH=${PYTHONPATH} "
217- ;;
218-
219- * )
220- echo " Unsupported gdb-${suffix} "
221- exit 1
222- ;;
223- esac
224-
225136 echo
226137 echo " Testing if gdb${suffix} starts properly..."
227138
@@ -240,11 +151,24 @@ function test_gdb()
240151 -ex=' set language auto' \
241152 -ex=' quit'
242153
154+ if [ " ${suffix} " == " -py3" ]
155+ then
156+ # Show Python paths.
157+ run_app " ${app_folder_path} /bin/${gcc_target_prefix} -gdb${suffix} " \
158+ --nh \
159+ --nx \
160+ -ex=' set pagination off' \
161+ -ex=' python import sys; print(sys.prefix)' \
162+ -ex=' python import sys; import os; print(os.pathsep.join(sys.path))' \
163+ -ex=' quit'
164+ fi
165+
243166 if [ ! -z " ${suffix} " ]
244167 then
245168 local out=$( " ${app_folder_path} /bin/${gcc_target_prefix} -gdb${suffix} " \
246169 --nh \
247170 --nx \
171+ -ex=' set pagination off' \
248172 -ex=' python print("babu"+"riba")' \
249173 -ex=' quit' | grep ' baburiba' )
250174 if [ " ${out} " == " baburiba" ]
@@ -291,20 +215,6 @@ function run_tests()
291215 run_app ldd -v " ${file_path} " || true
292216 done
293217 fi
294-
295- echo
296- echo " All tests completed successfully."
297-
298- echo
299- run_app uname -a
300- if [ " ${node_platform} " == " linux" ]
301- then
302- run_app lsb_release -a
303- run_app ldd --version
304- elif [ " ${node_platform} " == " darwin" ]
305- then
306- run_app sw_vers
307- fi
308218}
309219
310220# -----------------------------------------------------------------------------
0 commit comments