From 95c67be88128e3326e2323bd6e5a6592c1ca5ec7 Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 26 Jul 2024 15:09:46 +0200 Subject: [PATCH] Undo rename --- .../cbuilder/cbuilder_build_failure_test.dart | 2 +- .../cbuilder/cbuilder_cross_android_test.dart | 2 +- .../cbuilder/cbuilder_cross_ios_test.dart | 6 +++--- .../cbuilder_cross_linux_host_test.dart | 2 +- .../cbuilder_cross_macos_host_test.dart | 6 +++--- .../cbuilder_cross_windows_host_test.dart | 2 +- .../test/cbuilder/cbuilder_test.dart | 20 +++++++++---------- .../test/cbuilder/objective_c_test.dart | 2 +- .../{test_data => testfiles}/add/src/add.c | 0 .../add_objective_c/src/add.m | 0 .../defines/src/defines.c | 0 .../hello_world/src/hello_world.c | 0 .../hello_world_cpp/src/hello_world_cpp.cc | 0 .../includes/include/includes.h | 0 .../includes/src/includes.c | 0 .../test/clinker/build_testfiles.dart | 4 ++-- .../linker/symbols.lds | 0 .../{test_data => testfiles}/linker/test1.c | 0 .../{test_data => testfiles}/linker/test2.c | 0 .../test/clinker/treeshake_test.dart | 11 ++++++++-- 20 files changed, 32 insertions(+), 25 deletions(-) rename pkgs/native_toolchain_c/test/cbuilder/{test_data => testfiles}/add/src/add.c (100%) rename pkgs/native_toolchain_c/test/cbuilder/{test_data => testfiles}/add_objective_c/src/add.m (100%) rename pkgs/native_toolchain_c/test/cbuilder/{test_data => testfiles}/defines/src/defines.c (100%) rename pkgs/native_toolchain_c/test/cbuilder/{test_data => testfiles}/hello_world/src/hello_world.c (100%) rename pkgs/native_toolchain_c/test/cbuilder/{test_data => testfiles}/hello_world_cpp/src/hello_world_cpp.cc (100%) rename pkgs/native_toolchain_c/test/cbuilder/{test_data => testfiles}/includes/include/includes.h (100%) rename pkgs/native_toolchain_c/test/cbuilder/{test_data => testfiles}/includes/src/includes.c (100%) rename pkgs/native_toolchain_c/test/clinker/{test_data => testfiles}/linker/symbols.lds (100%) rename pkgs/native_toolchain_c/test/clinker/{test_data => testfiles}/linker/test1.c (100%) rename pkgs/native_toolchain_c/test/clinker/{test_data => testfiles}/linker/test2.c (100%) diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart index 2c873c055..767b1bf0f 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart @@ -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(); diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart index a4ad1d9f4..a5558f939 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart @@ -105,7 +105,7 @@ Future 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( diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart index 01a53eed5..5b67876f2 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart @@ -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( @@ -194,7 +194,7 @@ Future 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( diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart index 3e5827cbd..389c4f5ba 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart @@ -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( diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart index b5e3fdd11..6856d334b 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart @@ -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'; @@ -124,7 +124,7 @@ Future 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( diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart index 9d6ebd9a0..0af64e8c9 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart @@ -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( diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart index c17f9efdf..495e6091d 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart @@ -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.'); } @@ -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 = []; @@ -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.'); } @@ -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( @@ -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'; @@ -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.'); } @@ -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.'); } @@ -512,7 +512,7 @@ Future 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.'); } diff --git a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart index 27638ebb1..63cbb6b4d 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart @@ -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.'); } diff --git a/pkgs/native_toolchain_c/test/cbuilder/test_data/add/src/add.c b/pkgs/native_toolchain_c/test/cbuilder/testfiles/add/src/add.c similarity index 100% rename from pkgs/native_toolchain_c/test/cbuilder/test_data/add/src/add.c rename to pkgs/native_toolchain_c/test/cbuilder/testfiles/add/src/add.c diff --git a/pkgs/native_toolchain_c/test/cbuilder/test_data/add_objective_c/src/add.m b/pkgs/native_toolchain_c/test/cbuilder/testfiles/add_objective_c/src/add.m similarity index 100% rename from pkgs/native_toolchain_c/test/cbuilder/test_data/add_objective_c/src/add.m rename to pkgs/native_toolchain_c/test/cbuilder/testfiles/add_objective_c/src/add.m diff --git a/pkgs/native_toolchain_c/test/cbuilder/test_data/defines/src/defines.c b/pkgs/native_toolchain_c/test/cbuilder/testfiles/defines/src/defines.c similarity index 100% rename from pkgs/native_toolchain_c/test/cbuilder/test_data/defines/src/defines.c rename to pkgs/native_toolchain_c/test/cbuilder/testfiles/defines/src/defines.c diff --git a/pkgs/native_toolchain_c/test/cbuilder/test_data/hello_world/src/hello_world.c b/pkgs/native_toolchain_c/test/cbuilder/testfiles/hello_world/src/hello_world.c similarity index 100% rename from pkgs/native_toolchain_c/test/cbuilder/test_data/hello_world/src/hello_world.c rename to pkgs/native_toolchain_c/test/cbuilder/testfiles/hello_world/src/hello_world.c diff --git a/pkgs/native_toolchain_c/test/cbuilder/test_data/hello_world_cpp/src/hello_world_cpp.cc b/pkgs/native_toolchain_c/test/cbuilder/testfiles/hello_world_cpp/src/hello_world_cpp.cc similarity index 100% rename from pkgs/native_toolchain_c/test/cbuilder/test_data/hello_world_cpp/src/hello_world_cpp.cc rename to pkgs/native_toolchain_c/test/cbuilder/testfiles/hello_world_cpp/src/hello_world_cpp.cc diff --git a/pkgs/native_toolchain_c/test/cbuilder/test_data/includes/include/includes.h b/pkgs/native_toolchain_c/test/cbuilder/testfiles/includes/include/includes.h similarity index 100% rename from pkgs/native_toolchain_c/test/cbuilder/test_data/includes/include/includes.h rename to pkgs/native_toolchain_c/test/cbuilder/testfiles/includes/include/includes.h diff --git a/pkgs/native_toolchain_c/test/cbuilder/test_data/includes/src/includes.c b/pkgs/native_toolchain_c/test/cbuilder/testfiles/includes/src/includes.c similarity index 100% rename from pkgs/native_toolchain_c/test/cbuilder/test_data/includes/src/includes.c rename to pkgs/native_toolchain_c/test/cbuilder/testfiles/includes/src/includes.c diff --git a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart index cc7731c8d..84f2afbd3 100644 --- a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart +++ b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart @@ -10,8 +10,8 @@ import 'package:native_toolchain_c/native_toolchain_c.dart'; import '../helpers.dart'; Future 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.'); diff --git a/pkgs/native_toolchain_c/test/clinker/test_data/linker/symbols.lds b/pkgs/native_toolchain_c/test/clinker/testfiles/linker/symbols.lds similarity index 100% rename from pkgs/native_toolchain_c/test/clinker/test_data/linker/symbols.lds rename to pkgs/native_toolchain_c/test/clinker/testfiles/linker/symbols.lds diff --git a/pkgs/native_toolchain_c/test/clinker/test_data/linker/test1.c b/pkgs/native_toolchain_c/test/clinker/testfiles/linker/test1.c similarity index 100% rename from pkgs/native_toolchain_c/test/clinker/test_data/linker/test1.c rename to pkgs/native_toolchain_c/test/clinker/testfiles/linker/test1.c diff --git a/pkgs/native_toolchain_c/test/clinker/test_data/linker/test2.c b/pkgs/native_toolchain_c/test/clinker/testfiles/linker/test2.c similarity index 100% rename from pkgs/native_toolchain_c/test/clinker/test_data/linker/test2.c rename to pkgs/native_toolchain_c/test/clinker/testfiles/linker/test2.c diff --git a/pkgs/native_toolchain_c/test/clinker/treeshake_test.dart b/pkgs/native_toolchain_c/test/clinker/treeshake_test.dart index 78c87c417..1fdc61a09 100644 --- a/pkgs/native_toolchain_c/test/clinker/treeshake_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/treeshake_test.dart @@ -28,7 +28,7 @@ Future 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 sources) => CLinker.library( @@ -45,10 +45,17 @@ Future main() async { ); const os = OS.linux; + const architectures = [ + Architecture.arm, + Architecture.arm64, + Architecture.ia32, + Architecture.x64, + Architecture.riscv64, + ]; late Map sizes; sizes = {}; - for (final architecture in Architecture.values) { + for (final architecture in architectures) { for (final clinker in [ (name: 'manual', linker: linkerManual), (name: 'auto', linker: linkerAuto),