 
 /// Handle for a command as invoked by the low-level BuildSystem.
 public struct Command: Hashable, CustomStringConvertible, CustomDebugStringConvertible {
-    fileprivate let handle: OpaquePointer?
-
-    fileprivate init(_ handle: OpaquePointer?) {
-        self.handle = handle
+    private struct Values: Hashable {
+        let name: String
+        let shouldShowStatus: Bool
+        let description: String
+        let verboseDescription: String
+    }
+
+    private enum Representation: Hashable {
+        case handle(OpaquePointer?)
+        case values(Values)
+    }
+
+    private let representation: Representation
+
+    fileprivate init(handle: OpaquePointer?) {
+        self.representation = .handle(handle)
+    }
+
+    /// Creates a dummy `Command` with specific values for testing purposes.
+    public init(name: String, shouldShowStatus: Bool, description: String, verboseDescription: String) {
+        self.representation = .values(Values(
+            name: name,
+            shouldShowStatus: shouldShowStatus,
+            description: description,
+            verboseDescription: verboseDescription
+        ))
+    }
+
+    fileprivate var handle: OpaquePointer? {
+        switch representation {
+        case .handle(let handle):
+            return handle
+        case .values:
+            return nil
+        }
     }
 
     /// The command name.
     //
     // FIXME: We shouldn't need to expose this to use for mapping purposes, we should be able to use something more efficient.
     public var name: String {
-        var data = llb_data_t()
-        withUnsafeMutablePointer(to: &data) { (ptr: UnsafeMutablePointer<llb_data_t>) in
-            llb_buildsystem_command_get_name(handle, ptr)
-        }
-        return stringFromData(data)
+        switch representation {
+        case .handle(let handle):
+            var data = llb_data_t()
+            withUnsafeMutablePointer(to: &data) { (ptr: UnsafeMutablePointer<llb_data_t>) in
+                llb_buildsystem_command_get_name(handle, ptr)
+            }
+            return stringFromData(data)
+        case .values(let values):
+            return values.name
+        }
     }
 
     /// Whether the default status reporting shows status for the command.
     public var shouldShowStatus: Bool {
-        return llb_buildsystem_command_should_show_status(handle)
+        switch representation {
+        case .handle(let handle):
+            return llb_buildsystem_command_should_show_status(handle)
+        case .values(let values):
+            return values.shouldShowStatus
+        }
     }
 
     /// The description provided by the command.
     public var description: String {
-        let name = llb_buildsystem_command_get_description(handle)!
-        defer { free(name) }
-
-        return String(cString: name)
+        switch representation {
+        case .handle(let handle):
+            let name = llb_buildsystem_command_get_description(handle)!
+            defer { free(name) }
+            return String(cString: name)
+        case .values(let values):
+            return values.description
+        }
     }
 
     /// The verbose description provided by the command.
     public var verboseDescription: String {
-        let name = llb_buildsystem_command_get_verbose_description(handle)!
-        defer { free(name) }
-
-        return String(cString: name)
+        switch representation {
+        case .handle(let handle):
+            let name = llb_buildsystem_command_get_verbose_description(handle)!
+            defer { free(name) }
+            return String(cString: name)
+        case .values(let values):
+            return values.verboseDescription
+        } 
     }
 
     /// The debug description provides the verbose description.

        _delegate.execute_command = { return BuildSystem.toCommandWrapper($0!).executeCommand($1!, $2!, $3!, $4!) }

        // Create the low-level command.
        wrapper._command = Command(llb_buildsystem_external_command_create(name, _delegate))

        return wrapper._command.handle
    }


    init(command: ExternalCommand) {
        self.command = command
        self._command = Command(handle: nil)
    }

    func getSignature(_: OpaquePointer, _ data: UnsafeMutablePointer<llb_data_t>) {
