1 # Copyright (C) 2021-2023 Free Software Foundation, Inc.
3 # This file is part of the GNU Binutils.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 # gp-collect-app should follow descendants, which names match specified regular expressions
23 # This script tests the following cases:
26 # 3. collect -F =<REGULAR EXPRESSION>
28 set gprofng $::env(GPROFNG)
29 set tdir "tmpdir/gp-collect-app_F"
31 proc run_gp_collect_app { subExpCnt F_opt } {
33 set output [run_native_host_cmd "cd $tdir && \
34 $gprofng collect app -p on -a off -F '$F_opt' -O exp.er \
35 sh -c 'mkdir t && touch t/x; rm -rf t' "]
36 if { [lindex $output 0] != 0 } then {
37 set out [lindex $output 1]
38 send_log "Experiment is not created in $tdir\n"
43 set output [run_native_host_cmd "find $tdir -name '*x1.er' | wc -l"]
44 set subExp [lindex $output 1]
45 if { $subExp != $subExpCnt } then {
46 set out [lindex $output 1]
47 send_log "Test failed for -F $F_opt. subExp=$subExp. Shold be $subExpCnt\n"
54 run_native_host_cmd "mkdir -p $tdir"
56 run_gp_collect_app 0 "off"
57 run_gp_collect_app 3 "on"
58 run_gp_collect_app 1 "=mkd.r"
59 run_gp_collect_app 2 "=mkdir|touch"