Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
fe206e63
Commit
fe206e63
authored
Jul 28, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: handle spaces in $USER
Fixes #2107. R=golang-dev, r CC=golang-dev
https://golang.org/cl/4830042
parent
e0d6f950
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
22 deletions
+23
-22
src/cmd/gotry/gotry
src/cmd/gotry/gotry
+7
-6
src/quietgcc.bash
src/quietgcc.bash
+4
-4
test/run
test/run
+12
-12
No files found.
src/cmd/gotry/gotry
View file @
fe206e63
...
@@ -111,7 +111,8 @@ function getFunctions() {
...
@@ -111,7 +111,8 @@ function getFunctions() {
functions
=$(
getFunctions
)
functions
=$(
getFunctions
)
#
Write
file
to
compile
#
Write
file
to
compile
rm
-
f
/
tmp
/$
USER
.
try
.
go
file
=
"/tmp/$USER.try"
rm
-
f
"file.go"
(
(
cat
<<
'!'
cat
<<
'!'
package
main
package
main
...
@@ -159,9 +160,9 @@ var _ os.Error
...
@@ -159,9 +160,9 @@ var _ os.Error
func
toSlice
(
a
...
interface
{})
[]
interface
{}
{
return
a
}
func
toSlice
(
a
...
interface
{})
[]
interface
{}
{
return
a
}
!
!
)>
/
tmp
/$
USER
.
try
.
go
)>
"$file.go"
$
GC
-
o
/
tmp
/$
USER
.
try
.$
O
/
tmp
/$
USER
.
try
.
go
&&
$
GC
-
o
"$file.$O"
"$file.go"
&&
$
GL
-
o
/
tmp
/$
USER
.
try
/
tmp
/$
USER
.
try
.$
O
&&
$
GL
-
o
"$file"
"$file.$O"
&&
/
tmp
/$
USER
.
try
"_$@"
"$file"
"_$@"
rm
-
f
/
tmp
/$
USER
.
try
/
tmp
/$
USER
.
try
.
go
/
tmp
/$
USER
.
try
.$
O
rm
-
f
"$file"
"$file.go"
"$file.$O"
src/quietgcc.bash
View file @
fe206e63
...
@@ -32,13 +32,13 @@ case "$(uname -m -p)-$GOHOSTARCH" in
...
@@ -32,13 +32,13 @@ case "$(uname -m -p)-$GOHOSTARCH" in
esac
esac
# Run gcc, save error status, redisplay output without noise, exit with gcc status.
# Run gcc, save error status, redisplay output without noise, exit with gcc status.
tmp
=
${
TMPDIR
:-
/tmp
}
/quietgcc.
$$
.
$USER
.out
tmp
=
"
${
TMPDIR
:-
/tmp
}
/quietgcc.
$$
.
$USER
.out"
$gcc
-Wall
-Wno-sign-compare
-Wno-missing-braces
\
$gcc
-Wall
-Wno-sign-compare
-Wno-missing-braces
\
-Wno-parentheses
-Wno-unknown-pragmas
-Wno-switch
-Wno-comment
\
-Wno-parentheses
-Wno-unknown-pragmas
-Wno-switch
-Wno-comment
\
-Werror
\
-Werror
\
"
$@
"
>
$tmp
2>&1
"
$@
"
>
"
$tmp
"
2>&1
status
=
$?
status
=
$?
egrep
-v
"
$ignore
"
$tmp
|
uniq
|
tee
$tmp
.1
egrep
-v
"
$ignore
"
"
$tmp
"
|
uniq
|
tee
"
$tmp
.1"
rm
-f
$tmp
$tmp
.1
rm
-f
"
$tmp
"
"
$tmp
.1"
exit
$status
exit
$status
test/run
View file @
fe206e63
...
@@ -33,9 +33,9 @@ failed=0
...
@@ -33,9 +33,9 @@ failed=0
PATH
=
/bin:/usr/bin:/usr/local/bin:
${
GOBIN
:-
$GOROOT
/bin
}
:
`
pwd
`
PATH
=
/bin:/usr/bin:/usr/local/bin:
${
GOBIN
:-
$GOROOT
/bin
}
:
`
pwd
`
RUNFILE
=
/tmp/gorun-
$$
-
$USER
RUNFILE
=
"/tmp/gorun-
$$
-
$USER
"
TMP1FILE
=
/tmp/gotest1-
$$
-
$USER
TMP1FILE
=
"/tmp/gotest1-
$$
-
$USER
"
TMP2FILE
=
/tmp/gotest2-
$$
-
$USER
TMP2FILE
=
"/tmp/gotest2-
$$
-
$USER
"
# don't run the machine out of memory: limit individual processes to 4GB.
# don't run the machine out of memory: limit individual processes to 4GB.
# on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
# on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
...
@@ -64,20 +64,20 @@ do
...
@@ -64,20 +64,20 @@ do
fi
fi
export
F
=
$(
basename
$i
.go
)
export
F
=
$(
basename
$i
.go
)
export
D
=
$dir
export
D
=
$dir
sed
'/^\/\//!q'
$i
|
sed
's@//@@; $d'
|sed
's|./\$A.out|$E &|g'
>
$RUNFILE
sed
'/^\/\//!q'
$i
|
sed
's@//@@; $d'
|sed
's|./\$A.out|$E &|g'
>
"
$RUNFILE
"
if
!
{
time
-p
bash
-c
"bash
$RUNFILE
>
$TMP1FILE
2>&1"
;
}
2>
$TMP2FILE
if
!
{
time
-p
bash
-c
"bash
'
$RUNFILE
' >'
$TMP1FILE
' 2>&1"
;
}
2>
"
$TMP2FILE
"
then
then
echo
echo
echo
"==========="
$i
echo
"==========="
$i
cat
$TMP1FILE
cat
"
$TMP1FILE
"
echo
>
&2 fail:
$i
echo
>
&2 fail:
$i
echo
"#
$i
# fail"
>>
pass.out
echo
"#
$i
# fail"
>>
pass.out
elif
test
-s
$TMP1FILE
elif
test
-s
"
$TMP1FILE
"
then
then
echo
echo
echo
"==========="
$i
echo
"==========="
$i
cat
$TMP1FILE
cat
"
$TMP1FILE
"
if
grep
-q
'^BUG'
$TMP1FILE
if
grep
-q
'^BUG'
"
$TMP1FILE
"
then
then
if
[
$dir
!=
bugs
]
if
[
$dir
!=
bugs
]
then
then
...
@@ -93,13 +93,13 @@ do
...
@@ -93,13 +93,13 @@ do
else
else
echo
$i
>>
pass.out
echo
$i
>>
pass.out
fi
fi
echo
$(
awk
'NR==1{print $2}'
$TMP2FILE
)
$D
/
$F
>>
times.out
echo
$(
awk
'NR==1{print $2}'
"
$TMP2FILE
"
)
$D
/
$F
>>
times.out
rm
-f
$F
.
$A
$A
.out
rm
-f
$F
.
$A
$A
.out
)
done
)
done
done
|
# clean up some stack noise
done
|
# clean up some stack noise
egrep
-v
'^(r[0-9a-z]+|[cfg]s) +0x'
|
egrep
-v
'^(r[0-9a-z]+|[cfg]s) +0x'
|
sed
'/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/
sed
'/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/
s!'
$RUNFILE
'!$RUNFILE!g
s!'
"
$RUNFILE
"
'!$RUNFILE!g
s/^PC=0x[0-9a-f]*/pc: xxx/
s/^PC=0x[0-9a-f]*/pc: xxx/
s/^pc: 0x[0-9a-f]*/pc: xxx/
s/^pc: 0x[0-9a-f]*/pc: xxx/
s/PC=0x[0-9a-f]*/PC=xxx/
s/PC=0x[0-9a-f]*/PC=xxx/
...
@@ -110,7 +110,7 @@ done | # clean up some stack noise
...
@@ -110,7 +110,7 @@ done | # clean up some stack noise
/Segmentation fault/d
/Segmentation fault/d
/^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d'
>
run.out
/^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d'
>
run.out
rm
-f
$RUNFILE
$TMP1FILE
$TMP2FILE
*
.
$A
*
.a
$A
.out
rm
-f
"
$RUNFILE
"
"
$TMP1FILE
"
"
$TMP2FILE
"
*
.
$A
*
.a
$A
.out
diffmsg
=
""
diffmsg
=
""
if
!
diff
$golden
run.out
if
!
diff
$golden
run.out
then
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment