Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
b3588541
Unverified
Commit
b3588541
authored
Dec 03, 2020
by
J-P Nurmi
Committed by
GitHub
Dec 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Set basic error matcher for Linux builds (#71003)
parent
8817c0d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
build_linux.dart
packages/flutter_tools/lib/src/linux/build_linux.dart
+7
-0
build_linux_test.dart
..._tools/test/commands.shard/hermetic/build_linux_test.dart
+49
-0
No files found.
packages/flutter_tools/lib/src/linux/build_linux.dart
View file @
b3588541
...
...
@@ -16,6 +16,12 @@ import '../globals.dart' as globals;
import
'../plugins.dart'
;
import
'../project.dart'
;
// Matches the following error and warning patterns:
// - <file path>:<line>:<column>: error: <error...>
// - <file path>:<line>:<column>: warning: <warning...>
// - clang: error: <link error...>
final
RegExp
errorMatcher
=
RegExp
(
r'(?:.*:\d+:\d+|clang):\s?(?:error|warning):\s.*'
,
caseSensitive:
false
);
/// Builds the Linux project through the Makefile.
Future
<
void
>
buildLinux
(
LinuxProject
linuxProject
,
...
...
@@ -130,6 +136,7 @@ Future<void> _runBuild(Directory buildDir) async {
'VERBOSE_SCRIPT_LOGGING'
:
'true'
},
trace:
true
,
stdoutErrorMatcher:
errorMatcher
,
);
}
on
ArgumentError
{
throwToolExit
(
"ninja not found. Run 'flutter doctor' for more information."
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_linux_test.dart
View file @
b3588541
...
...
@@ -209,6 +209,55 @@ void main() {
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
),
});
testUsingContext
(
'Linux build extracts errors from stdout'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
setUpMockProjectFilesForBuild
();
// This contains a mix of routine build output and various types of errors
// (Dart error, compile error, link error), edited down for compactness.
const
String
stdout
=
r''
'
ninja: Entering directory `build/linux/release'
[
1
/
6
]
Generating
/
foo
/
linux
/
flutter
/
ephemeral
/
libflutter_linux_gtk
.
so
,
/
foo
/
linux
/
flutter
/
ephemeral
/
flutter_linux
/
flutter_linux
.
h
,
_phony
lib
/
main
.
dart
:
4
:
3
:
Error:
Method
not
found:
'foo'
.
[
2
/
6
]
Building
CXX
object
CMakeFiles
/
foo
.
dir
/
main
.
cc
.
o
/
foo
/
linux
/
main
.
cc
:
6
:
2
:
error:
expected
';'
after
class
/
foo
/
linux
/
main
.
cc
:
9
:
7
:
warning:
unused
variable
'unused_variable'
[-
Wunused
-
variable
]
/
foo
/
linux
/
main
.
cc
:
10
:
3
:
error:
unknown
type
name
'UnknownType'
/
foo
/
linux
/
main
.
cc
:
12
:
7
:
error:
'bar'
is
a
private
member
of
'Foo'
[
3
/
6
]
Building
CXX
object
CMakeFiles
/
foo_bar
.
dir
/
flutter
/
generated_plugin_registrant
.
cc
.
o
[
4
/
6
]
Building
CXX
object
CMakeFiles
/
foo_bar
.
dir
/
my_application
.
cc
.
o
[
5
/
6
]
Linking
CXX
executable
intermediates_do_not_run
/
foo_bar
main
.
cc
:(.
text
+
0x13
):
undefined
reference
to
`
Foo:
:
bar
()
'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
'''
;
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
cmakeCommand
(
'release'
),
ninjaCommand
(
'release'
,
stdout:
stdout
,
),
]);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'linux'
,
'--no-pub'
]
);
// Just the warnings and errors should be surfaced.
expect
(
testLogger
.
errorText
,
r''
'
lib/main.dart:4:3: Error: Method not found: '
foo
'.
/foo/linux/main.cc:6:2: error: expected '
;
' after class
/foo/linux/main.cc:9:7: warning: unused variable '
unused_variable
' [-Wunused-variable]
/foo/linux/main.cc:10:3: error: unknown type name '
UnknownType
'
/foo/linux/main.cc:12:7: error: '
bar
' is a private member of '
Foo
'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
'''
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
Platform:
()
=>
linuxPlatform
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
),
});
testUsingContext
(
'Linux verbose build sets VERBOSE_SCRIPT_LOGGING'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
setUpMockProjectFilesForBuild
();
...
...
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