Minimal test harness for iOS (flutter/engine#13029)
This commit is contained in:
20
engine/src/flutter/build/darwin/ios_app.gni
Normal file
20
engine/src/flutter/build/darwin/ios_app.gni
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
template("ios_app") {
|
||||
assert(is_ios)
|
||||
|
||||
copy("${target_name}__info_plist") {
|
||||
sources = [ invoker.info_plist ]
|
||||
outputs = [ "$root_out_dir/${target_name}.app/Info.plist" ]
|
||||
}
|
||||
executable("$target_name") {
|
||||
forward_variables_from(invoker, "*")
|
||||
output_name = "${target_name}.app/$target_name"
|
||||
|
||||
deps += [
|
||||
":${target_name}__info_plist",
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -731,6 +731,8 @@ FILE: ../../../flutter/shell/platform/darwin/common/framework/Source/FlutterStan
|
||||
FILE: ../../../flutter/shell/platform/darwin/common/framework/Source/FlutterStandardCodec_Internal.h
|
||||
FILE: ../../../flutter/shell/platform/darwin/common/framework/Source/flutter_codecs_unittest.mm
|
||||
FILE: ../../../flutter/shell/platform/darwin/common/framework/Source/flutter_standard_codec_unittest.mm
|
||||
FILE: ../../../flutter/shell/platform/darwin/ios/FlutterTestsInfo.plist
|
||||
FILE: ../../../flutter/shell/platform/darwin/ios/flutter_unittests.mm
|
||||
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Flutter.podspec
|
||||
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h
|
||||
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
assert(is_ios)
|
||||
|
||||
import("//build/config/ios/ios_sdk.gni")
|
||||
import("$flutter_root/build/darwin/ios_app.gni")
|
||||
import("$flutter_root/common/config.gni")
|
||||
import("$flutter_root/shell/gpu/gpu.gni")
|
||||
import("$flutter_root/shell/platform/darwin/common/framework_shared.gni")
|
||||
import("$flutter_root/testing/testing.gni")
|
||||
|
||||
_flutter_framework_dir = "$root_out_dir/Flutter.framework"
|
||||
|
||||
@@ -248,6 +250,30 @@ shared_library("copy_and_verify_framework_headers") {
|
||||
]
|
||||
}
|
||||
|
||||
test_fixtures("flutter_tests_fixtures") {
|
||||
fixtures = []
|
||||
}
|
||||
|
||||
ios_app("FlutterTests") {
|
||||
testonly = true
|
||||
|
||||
info_plist = "FlutterTestsInfo.plist"
|
||||
|
||||
sources = [
|
||||
"flutter_unittests.mm",
|
||||
]
|
||||
|
||||
libs = [
|
||||
"Foundation.framework",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":flutter_tests_fixtures",
|
||||
"//flutter/runtime:libdart",
|
||||
"//flutter/testing",
|
||||
]
|
||||
}
|
||||
|
||||
group("flutter_framework") {
|
||||
deps = [
|
||||
":copy_and_verify_framework_headers",
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>FlutterTests</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.flutter.FlutterTests</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>FlutterTests</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,19 @@
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include "flutter/testing/testing.h"
|
||||
|
||||
namespace flutter_tests {
|
||||
|
||||
TEST(SmokeTest, Success) {
|
||||
EXPECT_EQ(1, 1);
|
||||
}
|
||||
|
||||
TEST(SmokeTest, Fail) {
|
||||
EXPECT_EQ(1, 2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,9 +2,21 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "flutter/fml/build_config.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#ifdef OS_IOS
|
||||
#include <asl.h>
|
||||
#endif // OS_IOS
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef OS_IOS
|
||||
asl_log_descriptor(NULL, NULL, ASL_LEVEL_NOTICE, STDOUT_FILENO,
|
||||
ASL_LOG_DESCRIPTOR_WRITE);
|
||||
asl_log_descriptor(NULL, NULL, ASL_LEVEL_ERR, STDERR_FILENO,
|
||||
ASL_LOG_DESCRIPTOR_WRITE);
|
||||
#endif // OS_IOS
|
||||
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user