Skip to content

Commit

Permalink
Undo rename
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem committed Jul 26, 2024
1 parent b631354 commit 95c67be
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main() {
test('build failure', () async {
final tempUri = await tempDirForTest();
final addCOriginalUri =
packageUri.resolve('test/cbuilder/test_data/add/src/add.c');
packageUri.resolve('test/cbuilder/testfiles/add/src/add.c');
final addCUri = tempUri.resolve('add.c');
final addCOriginalContents =
await File.fromUri(addCOriginalUri).readAsString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Future<Uri> buildLib(
int androidNdkApi,
LinkMode linkMode,
) async {
final addCUri = packageUri.resolve('test/cbuilder/test_data/add/src/add.c');
final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c');
const name = 'add';

final buildConfig = BuildConfig.build(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ void main() {
final tempUri = await tempDirForTest();
final sourceUri = switch (language) {
Language.c =>
packageUri.resolve('test/cbuilder/test_data/add/src/add.c'),
packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'),
Language.objectiveC => packageUri.resolve(
'test/cbuilder/test_data/add_objective_c/src/add.m'),
'test/cbuilder/testfiles/add_objective_c/src/add.m'),
Language() => throw UnimplementedError(),
};
final buildConfig = BuildConfig.build(
Expand Down Expand Up @@ -194,7 +194,7 @@ Future<Uri> buildLib(
int targetIOSVersion,
LinkMode linkMode,
) async {
final addCUri = packageUri.resolve('test/cbuilder/test_data/add/src/add.c');
final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c');
const name = 'add';

final buildConfig = BuildConfig.build(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void main() {
test('CBuilder $linkMode library $target', () async {
final tempUri = await tempDirForTest();
final addCUri =
packageUri.resolve('test/cbuilder/test_data/add/src/add.c');
packageUri.resolve('test/cbuilder/testfiles/add/src/add.c');
const name = 'add';

final buildConfig = BuildConfig.build(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ void main() {
final tempUri = await tempDirForTest();
final sourceUri = switch (language) {
Language.c =>
packageUri.resolve('test/cbuilder/test_data/add/src/add.c'),
packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'),
Language.objectiveC => packageUri
.resolve('test/cbuilder/test_data/add_objective_c/src/add.m'),
.resolve('test/cbuilder/testfiles/add_objective_c/src/add.m'),
Language() => throw UnimplementedError(),
};
const name = 'add';
Expand Down Expand Up @@ -124,7 +124,7 @@ Future<Uri> buildLib(
int targetMacOSVersion,
LinkMode linkMode,
) async {
final addCUri = packageUri.resolve('test/cbuilder/test_data/add/src/add.c');
final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c');
const name = 'add';

final buildConfig = BuildConfig.build(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void main() {
test('CBuilder $linkMode library $target', () async {
final tempUri = await tempDirForTest();
final addCUri =
packageUri.resolve('test/cbuilder/test_data/add/src/add.c');
packageUri.resolve('test/cbuilder/testfiles/add/src/add.c');
const name = 'add';

final buildConfig = BuildConfig.build(
Expand Down
20 changes: 10 additions & 10 deletions pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void main() {
test('CBuilder executable$suffix', () async {
final tempUri = await tempDirForTest();
final helloWorldCUri = packageUri
.resolve('test/cbuilder/test_data/hello_world/src/hello_world.c');
.resolve('test/cbuilder/testfiles/hello_world/src/hello_world.c');
if (!await File.fromUri(helloWorldCUri).exists()) {
throw Exception('Run the test from the root directory.');
}
Expand Down Expand Up @@ -109,7 +109,7 @@ void main() {
test('CBuilder dylib$suffix', () async {
final tempUri = await tempDirForTest();
final addCUri =
packageUri.resolve('test/cbuilder/test_data/add/src/add.c');
packageUri.resolve('test/cbuilder/testfiles/add/src/add.c');
const name = 'add';

final logMessages = <String>[];
Expand Down Expand Up @@ -208,7 +208,7 @@ void main() {
test('CBuilder flags', () async {
final tempUri = await tempDirForTest();
final definesCUri =
packageUri.resolve('test/cbuilder/test_data/defines/src/defines.c');
packageUri.resolve('test/cbuilder/testfiles/defines/src/defines.c');
if (!await File.fromUri(definesCUri).exists()) {
throw Exception('Run the test from the root directory.');
}
Expand Down Expand Up @@ -269,11 +269,11 @@ void main() {
test('CBuilder includes', () async {
final tempUri = await tempDirForTest();
final includeDirectoryUri =
packageUri.resolve('test/cbuilder/test_data/includes/include');
packageUri.resolve('test/cbuilder/testfiles/includes/include');
final includesHUri = packageUri
.resolve('test/cbuilder/test_data/includes/include/includes.h');
.resolve('test/cbuilder/testfiles/includes/include/includes.h');
final includesCUri =
packageUri.resolve('test/cbuilder/test_data/includes/src/includes.c');
packageUri.resolve('test/cbuilder/testfiles/includes/src/includes.c');
const name = 'includes';

final buildConfig = BuildConfig.build(
Expand Down Expand Up @@ -315,7 +315,7 @@ void main() {

test('CBuilder std', () async {
final tempUri = await tempDirForTest();
final addCUri = packageUri.resolve('test/cbuilder/test_data/add/src/add.c');
final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c');
const name = 'add';
const std = 'c99';

Expand Down Expand Up @@ -372,7 +372,7 @@ void main() {
test('CBuilder compile c++', () async {
final tempUri = await tempDirForTest();
final helloWorldCppUri = packageUri.resolve(
'test/cbuilder/test_data/hello_world_cpp/src/hello_world_cpp.cc');
'test/cbuilder/testfiles/hello_world_cpp/src/hello_world_cpp.cc');
if (!await File.fromUri(helloWorldCppUri).exists()) {
throw Exception('Run the test from the root directory.');
}
Expand Down Expand Up @@ -437,7 +437,7 @@ void main() {
test('CBuilder cppLinkStdLib', () async {
final tempUri = await tempDirForTest();
final helloWorldCppUri = packageUri.resolve(
'test/cbuilder/test_data/hello_world_cpp/src/hello_world_cpp.cc');
'test/cbuilder/testfiles/hello_world_cpp/src/hello_world_cpp.cc');
if (!await File.fromUri(helloWorldCppUri).exists()) {
throw Exception('Run the test from the root directory.');
}
Expand Down Expand Up @@ -512,7 +512,7 @@ Future<void> testDefines({
}) async {
final tempUri = await tempDirForTest();
final definesCUri =
packageUri.resolve('test/cbuilder/test_data/defines/src/defines.c');
packageUri.resolve('test/cbuilder/testfiles/defines/src/defines.c');
if (!await File.fromUri(definesCUri).exists()) {
throw Exception('Run the test from the root directory.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void main() {
test('CBuilder compile objective c', () async {
final tempUri = await tempDirForTest();
final addMUri =
packageUri.resolve('test/cbuilder/test_data/add_objective_c/src/add.m');
packageUri.resolve('test/cbuilder/testfiles/add_objective_c/src/add.m');
if (!await File.fromUri(addMUri).exists()) {
throw Exception('Run the test from the root directory.');
}
Expand Down
4 changes: 2 additions & 2 deletions pkgs/native_toolchain_c/test/clinker/build_testfiles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import 'package:native_toolchain_c/native_toolchain_c.dart';
import '../helpers.dart';

Future<Uri> buildTestArchive(Uri tempUri) async {
final test1Uri = packageUri.resolve('test/clinker/test_data/linker/test1.c');
final test2Uri = packageUri.resolve('test/clinker/test_data/linker/test2.c');
final test1Uri = packageUri.resolve('test/clinker/testfiles/linker/test1.c');
final test2Uri = packageUri.resolve('test/clinker/testfiles/linker/test2.c');
if (!await File.fromUri(test1Uri).exists() ||
!await File.fromUri(test2Uri).exists()) {
throw Exception('Run the test from the root directory.');
Expand Down
11 changes: 9 additions & 2 deletions pkgs/native_toolchain_c/test/clinker/treeshake_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Future<void> main() async {
linkerOptions: LinkerOptions.manual(
flags: ['--strip-debug', '-u', 'my_other_func'],
gcSections: true,
linkerScript: Uri.file('test/clinker/test_data/linker/symbols.lds'),
linkerScript: Uri.file('test/clinker/testfiles/linker/symbols.lds'),
),
);
CLinker linkerAuto(List<String> sources) => CLinker.library(
Expand All @@ -45,10 +45,17 @@ Future<void> main() async {
);

const os = OS.linux;
const architectures = [
Architecture.arm,
Architecture.arm64,
Architecture.ia32,
Architecture.x64,
Architecture.riscv64,
];

late Map<String, int> sizes;
sizes = <String, int>{};
for (final architecture in Architecture.values) {
for (final architecture in architectures) {
for (final clinker in [
(name: 'manual', linker: linkerManual),
(name: 'auto', linker: linkerAuto),
Expand Down

0 comments on commit 95c67be

Please sign in to comment.