Diff
Modified: trunk/Source/WebGPU/ChangeLog (285912 => 285913)
--- trunk/Source/WebGPU/ChangeLog 2021-11-17 02:55:32 UTC (rev 285912)
+++ trunk/Source/WebGPU/ChangeLog 2021-11-17 03:14:06 UTC (rev 285913)
@@ -1,3 +1,19 @@
+2021-11-16 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ [WebGPU] Add WGSLUnitTests XCTest target for WebGPU
+ https://bugs.webkit.org/show_bug.cgi?id=233227
+
+ Reviewed by Robin Morisset.
+
+ For now, this new target isn't hooked up to any automated testing - it's just a local target which developers can run.
+
+ * Configurations/WGSLUnitTests.xcconfig: Added.
+ * WGSLUnitTests/WGSLUnitTests.mm: Added.
+ (-[WGSLUnitTests testExample]):
+ * WebGPU.xcodeproj/project.pbxproj:
+ * WebGPU.xcodeproj/xcshareddata/xcschemes/WGSL.xcscheme:
+ * WebGPU.xcodeproj/xcshareddata/xcschemes/WGSLUnitTests.xcscheme: Copied from Source/WebGPU/WebGPU.xcodeproj/xcshareddata/xcschemes/WGSL.xcscheme.
+
2021-11-14 Myles C. Maxfield <mmaxfi...@apple.com>
[WebGPU] Add necessary additions to WebGPU.framework
Added: trunk/Source/WebGPU/Configurations/WGSLUnitTests.xcconfig (0 => 285913)
--- trunk/Source/WebGPU/Configurations/WGSLUnitTests.xcconfig (rev 0)
+++ trunk/Source/WebGPU/Configurations/WGSLUnitTests.xcconfig 2021-11-17 03:14:06 UTC (rev 285913)
@@ -0,0 +1,28 @@
+// Copyright (C) 2014-2021 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+EXECUTABLE_PREFIX = lib;
+HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/usr/local/include" $(inherited);
+PRODUCT_NAME = WGSLUnitTests;
+ENABLE_TESTABILITY = YES;
+GENERATE_INFOPLIST_FILE = YES;
Added: trunk/Source/WebGPU/WGSLUnitTests/WGSLUnitTests.mm (0 => 285913)
--- trunk/Source/WebGPU/WGSLUnitTests/WGSLUnitTests.mm (rev 0)
+++ trunk/Source/WebGPU/WGSLUnitTests/WGSLUnitTests.mm 2021-11-17 03:14:06 UTC (rev 285913)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <XCTest/XCTest.h>
+#import <vector>
+#import <wtf/Vector.h>
+
+@interface WGSLUnitTests : XCTestCase
+
+@end
+
+@implementation WGSLUnitTests
+
+- (void)testExample {
+ Vector<int> x { 2, 3, };
+ Vector<int> y;
+ y.append(2);
+ y.append(3);
+ XCTAssertEqual(x, y);
+}
+
+@end
Modified: trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj (285912 => 285913)
--- trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj 2021-11-17 02:55:32 UTC (rev 285912)
+++ trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj 2021-11-17 03:14:06 UTC (rev 285913)
@@ -7,6 +7,9 @@
objects = {
/* Begin PBXBuildFile section */
+ 1C023D3F27449070001DB734 /* WGSLUnitTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C023D3E27449070001DB734 /* WGSLUnitTests.mm */; };
+ 1C023D4027449070001DB734 /* libwgsl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CEBD7F22716B2CC00A5254D /* libwgsl.a */; };
+ 1C023D4B274495B9001DB734 /* _javascript_Core.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C023D4A274495B9001DB734 /* _javascript_Core.framework */; };
1C2CEDEE271E8A7300EDC16F /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C2CEDED271E8A7300EDC16F /* Metal.framework */; };
1C5ACA94273A41C20095F8D5 /* Instance.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C5ACA92273A41C20095F8D5 /* Instance.mm */; };
1C5ACAB6273A426D0095F8D5 /* RenderPipeline.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C5ACA98273A426D0095F8D5 /* RenderPipeline.mm */; };
@@ -41,6 +44,13 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
+ 1C023D4127449070001DB734 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 1CEBD7DA2716AFBA00A5254D /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 1CEBD7F12716B2CC00A5254D;
+ remoteInfo = WGSL;
+ };
1CEBD8272716CACC00A5254D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 1CEBD7DA2716AFBA00A5254D /* Project object */;
@@ -51,6 +61,10 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 1C023D3C27449070001DB734 /* WGSLUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WGSLUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1C023D3E27449070001DB734 /* WGSLUnitTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WGSLUnitTests.mm; sourceTree = "<group>"; };
+ 1C023D472744916D001DB734 /* WGSLUnitTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WGSLUnitTests.xcconfig; sourceTree = "<group>"; };
+ 1C023D4A274495B9001DB734 /* _javascript_Core.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = _javascript_Core.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1C2CEDED271E8A7300EDC16F /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
1C5ACA92273A41C20095F8D5 /* Instance.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Instance.mm; sourceTree = "<group>"; };
1C5ACA96273A426D0095F8D5 /* Surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Surface.h; sourceTree = "<group>"; };
@@ -124,6 +138,15 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
+ 1C023D3927449070001DB734 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1C023D4B274495B9001DB734 /* _javascript_Core.framework in Frameworks */,
+ 1C023D4027449070001DB734 /* libwgsl.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
1CEBD7E02716AFBA00A5254D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -144,6 +167,14 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
+ 1C023D3D27449070001DB734 /* WGSLUnitTests */ = {
+ isa = PBXGroup;
+ children = (
+ 1C023D3E27449070001DB734 /* WGSLUnitTests.mm */,
+ );
+ path = WGSLUnitTests;
+ sourceTree = "<group>";
+ };
1CEBD7D92716AFBA00A5254D = {
isa = PBXGroup;
children = (
@@ -151,6 +182,7 @@
1CEBD7F92716B38600A5254D /* Configurations */,
1CEBD7F62716B33100A5254D /* WGSL */,
1CEBD7E52716AFBA00A5254D /* WebGPU */,
+ 1C023D3D27449070001DB734 /* WGSLUnitTests */,
1CEBD7E42716AFBA00A5254D /* Products */,
1CEBD8252716CACC00A5254D /* Frameworks */,
);
@@ -161,6 +193,7 @@
children = (
1CEBD7F22716B2CC00A5254D /* libwgsl.a */,
1CEBD7E32716AFBA00A5254D /* WebGPU.framework */,
+ 1C023D3C27449070001DB734 /* WGSLUnitTests.xctest */,
);
name = Products;
sourceTree = "<group>";
@@ -243,6 +276,7 @@
1CC0C8CA273A819100D0B481 /* Version.xcconfig */,
1CEBD7FC2716B64400A5254D /* WebGPU.xcconfig */,
1CEBD7FD2716B64F00A5254D /* WGSL.xcconfig */,
+ 1C023D472744916D001DB734 /* WGSLUnitTests.xcconfig */,
);
path = Configurations;
sourceTree = "<group>";
@@ -252,6 +286,7 @@
children = (
1CEBD82B2716CAFB00A5254D /* CoreFoundation.framework */,
1CEBD82D2716CB1600A5254D /* Foundation.framework */,
+ 1C023D4A274495B9001DB734 /* _javascript_Core.framework */,
1CBAB0912718CCA0006080BB /* _javascript_Core.framework */,
1CEBD8302716CB3800A5254D /* libicucore.tbd */,
1CEBD8292716CAE700A5254D /* libWTF.a */,
@@ -284,6 +319,24 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
+ 1C023D3B27449070001DB734 /* WGSLUnitTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1C023D4627449070001DB734 /* Build configuration list for PBXNativeTarget "WGSLUnitTests" */;
+ buildPhases = (
+ 1C023D3827449070001DB734 /* Sources */,
+ 1C023D3927449070001DB734 /* Frameworks */,
+ 1C023D3A27449070001DB734 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 1C023D4227449070001DB734 /* PBXTargetDependency */,
+ );
+ name = WGSLUnitTests;
+ productName = WGSLUnitTests;
+ productReference = 1C023D3C27449070001DB734 /* WGSLUnitTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
1CEBD7E22716AFBA00A5254D /* WebGPU */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1CEBD7EA2716AFBA00A5254D /* Build configuration list for PBXNativeTarget "WebGPU" */;
@@ -329,6 +382,9 @@
BuildIndependentTargetsInParallel = NO;
LastUpgradeCheck = 1330;
TargetAttributes = {
+ 1C023D3B27449070001DB734 = {
+ CreatedOnToolsVersion = 13.3;
+ };
1CEBD7E22716AFBA00A5254D = {
CreatedOnToolsVersion = 13.3;
};
@@ -352,11 +408,19 @@
targets = (
1CEBD7E22716AFBA00A5254D /* WebGPU */,
1CEBD7F12716B2CC00A5254D /* WGSL */,
+ 1C023D3B27449070001DB734 /* WGSLUnitTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
+ 1C023D3A27449070001DB734 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
1CEBD7E12716AFBA00A5254D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -367,6 +431,14 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ 1C023D3827449070001DB734 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1C023D3F27449070001DB734 /* WGSLUnitTests.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
1CEBD7DF2716AFBA00A5254D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -408,6 +480,11 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
+ 1C023D4227449070001DB734 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 1CEBD7F12716B2CC00A5254D /* WGSL */;
+ targetProxy = 1C023D4127449070001DB734 /* PBXContainerItemProxy */;
+ };
1CEBD8282716CACC00A5254D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 1CEBD7F12716B2CC00A5254D /* WGSL */;
@@ -416,6 +493,27 @@
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
+ 1C023D4327449070001DB734 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 1C023D472744916D001DB734 /* WGSLUnitTests.xcconfig */;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ 1C023D4427449070001DB734 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 1C023D472744916D001DB734 /* WGSLUnitTests.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+ 1C023D4527449070001DB734 /* Production */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 1C023D472744916D001DB734 /* WGSLUnitTests.xcconfig */;
+ buildSettings = {
+ };
+ name = Production;
+ };
1CEBD7E82716AFBA00A5254D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1CEBD7FB2716B5B400A5254D /* DebugRelease.xcconfig */;
@@ -482,6 +580,16 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ 1C023D4627449070001DB734 /* Build configuration list for PBXNativeTarget "WGSLUnitTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1C023D4327449070001DB734 /* Debug */,
+ 1C023D4427449070001DB734 /* Release */,
+ 1C023D4527449070001DB734 /* Production */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Production;
+ };
1CEBD7DD2716AFBA00A5254D /* Build configuration list for PBXProject "WebGPU" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Modified: trunk/Source/WebGPU/WebGPU.xcodeproj/xcshareddata/xcschemes/WGSL.xcscheme (285912 => 285913)
--- trunk/Source/WebGPU/WebGPU.xcodeproj/xcshareddata/xcschemes/WGSL.xcscheme 2021-11-17 02:55:32 UTC (rev 285912)
+++ trunk/Source/WebGPU/WebGPU.xcodeproj/xcshareddata/xcschemes/WGSL.xcscheme 2021-11-17 03:14:06 UTC (rev 285913)
@@ -28,6 +28,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1C023D3B27449070001DB734"
+ BuildableName = "WGSLUnitTests.xctest"
+ BlueprintName = "WGSLUnitTests"
+ ReferencedContainer = "container:WebGPU.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
</Testables>
</TestAction>
<LaunchAction
Copied: trunk/Source/WebGPU/WebGPU.xcodeproj/xcshareddata/xcschemes/WGSLUnitTests.xcscheme (from rev 285912, trunk/Source/WebGPU/WebGPU.xcodeproj/xcshareddata/xcschemes/WGSL.xcscheme) (0 => 285913)
--- trunk/Source/WebGPU/WebGPU.xcodeproj/xcshareddata/xcschemes/WGSLUnitTests.xcscheme (rev 0)
+++ trunk/Source/WebGPU/WebGPU.xcodeproj/xcshareddata/xcschemes/WGSLUnitTests.xcscheme 2021-11-17 03:14:06 UTC (rev 285913)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "1330"
+ version = "1.7">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1C023D3B27449070001DB734"
+ BuildableName = "WGSLUnitTests.xctest"
+ BlueprintName = "WGSLUnitTests"
+ ReferencedContainer = "container:WebGPU.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+ <InstallAction
+ buildConfiguration = "Release">
+ </InstallAction>
+</Scheme>