Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
e577f32e
Commit
e577f32e
authored
May 14, 2012
by
Florian Hölzl
Browse files
fixed smoke tests of gcc tool chain
refs 727
parent
d55c78ac
Changes
4
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.tools/trunk/src/org/fortiss/af3/tools/gcc/GCCRunner.java
View file @
e577f32e
...
...
@@ -73,4 +73,10 @@ public class GCCRunner extends GCCToolChainRunnerBase {
int
startOfVersioningInfo
=
helpMessage
.
indexOf
(
"gcc version "
);
return
helpMessage
.
substring
(
startOfVersioningInfo
+
12
,
startOfVersioningInfo
+
17
);
}
/** {@inheritDoc} */
@Override
protected
boolean
useErrorOutputForVersion
()
{
return
true
;
}
}
org.fortiss.af3.tools/trunk/src/org/fortiss/af3/tools/gcc/GCCToolChainRunnerBase.java
View file @
e577f32e
...
...
@@ -45,20 +45,28 @@ public abstract class GCCToolChainRunnerBase extends SimpleToolRunnerBase<File>
/** {@inheritDoc} */
@Override
public
String
testToolAvailability
()
{
String
toolCmd
=
"which "
+
getToolCommand
()
+
" && "
+
getToolCommand
();
Pair
<
String
,
String
>
outputs
=
smokeToolRun
(
toolCmd
,
"-v"
);
if
(
outputs
!=
null
&&
outputs
.
getSecond
().
length
()
>
0
)
{
String
helpMessage
=
outputs
.
getSecond
();
String
whichOutput
=
"/"
+
getToolCommand
()
+
"\n"
;
int
endOfWhichLocation
=
helpMessage
.
indexOf
(
whichOutput
)
+
whichOutput
.
length
();
String
whichLocation
=
helpMessage
.
substring
(
0
,
endOfWhichLocation
-
1
);
return
whichLocation
+
" "
+
getVersionInfo
(
helpMessage
);
Pair
<
String
,
String
>
outputs
=
smokeToolRun
(
getToolCommand
(),
getVersionOption
());
if
(
outputs
!=
null
)
{
if
(
useErrorOutputForVersion
()
&&
outputs
.
getSecond
().
length
()
>
0
)
{
return
getVersionInfo
(
outputs
.
getSecond
());
}
if
(!
useErrorOutputForVersion
()
&&
outputs
.
getFirst
().
length
()
>
0
)
{
return
getVersionInfo
(
outputs
.
getFirst
());
}
}
return
null
;
}
/** Returns the version info contained in the given help message. The default */
/** Flag for using normal or error output for version info. The default uses the normal output. */
protected
boolean
useErrorOutputForVersion
()
{
return
false
;
}
/** Returns the version option. The default is {@code -v}. */
protected
String
getVersionOption
()
{
return
"-v"
;
}
/** Returns the version info contained in the given help message. */
protected
abstract
String
getVersionInfo
(
String
helpMessage
);
}
org.fortiss.af3.tools/trunk/src/org/fortiss/af3/tools/gcc/MakeRunner.java
View file @
e577f32e
...
...
@@ -71,7 +71,7 @@ public class MakeRunner extends GCCToolChainRunnerBase {
/** {@inheritDoc} */
@Override
protected
String
getVersionInfo
(
String
helpMessage
)
{
int
startOfVersioningInfo
=
helpMessage
.
indexOf
(
"GNU Make "
);
return
helpMessage
.
substring
(
startOfVersioningInfo
+
9
,
startOfVersioningInfo
+
4
);
int
startOfVersioningInfo
=
helpMessage
.
indexOf
(
"GNU Make "
)
+
9
;
return
helpMessage
.
substring
(
startOfVersioningInfo
,
startOfVersioningInfo
+
4
);
}
}
org.fortiss.af3.tools/trunk/src/org/fortiss/af3/tools/gcc/ShellRunner.java
View file @
e577f32e
...
...
@@ -65,13 +65,19 @@ public class ShellRunner extends GCCToolChainRunnerBase {
@Override
public
String
[]
getCommandList
()
{
// FIXME: -version
return
new
String
[]
{
"-version"
};
return
new
String
[]
{
getVersionOption
()};
}
/** {@inheritDoc} */
@Override
protected
String
getVersionOption
()
{
return
"-version"
;
}
/** {@inheritDoc} */
@Override
protected
String
getVersionInfo
(
String
helpMessage
)
{
int
startOfVersioningInfo
=
helpMessage
.
indexOf
(
"version "
);
return
helpMessage
.
substring
(
startOfVersioningInfo
+
8
,
startOfVersioningInfo
+
6
);
int
startOfVersioningInfo
=
helpMessage
.
indexOf
(
"version "
)
+
8
;
return
helpMessage
.
substring
(
startOfVersioningInfo
,
startOfVersioningInfo
+
6
);
}
}
Write
Preview
Supports
Markdown
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