Tests - anconaesselmann/CLSPM GitHub Wiki

Test plan

init command

JSON spmfile


INIT_JSON_T1_D0:

Description:

init is run on a new project without any SPM packages.

Setup:
  • ~/.swiftclpm
  • Project:
    • Targets: "MyApp", "MyAppTests", "MyAppUITests".
    • Package Dependencies: none
Command:
init
Outcome:
  • Project directory

    spmfile (JSON) with one target and no dependencies is generated
      {
        "dependencies" : [
    
        ],
        "targets" : [
          {
            "dependencies" : [
    
            ],
            "id" : "9D6FC795-45A9-457C-919F-D8CE20A9DFDA",
            "name" : "MyApp"
          }
        ]
      }
    

INIT_JSON_OPT_T1_R1/R2:

Description:

init is run on a new project without any SPM packages. Two dependencies have been cashed previously.

Setup:
  • ~/.swiftclpm

    `dependencies` file
      {
        "dependencies" : [
          {
            "id" : "AA39C307-0F4C-4482-916E-23D715D7BE8A",
            "name" : "LoadableView",
            "url" : "https://github.com/anconaesselmann/LoadableView",
            "version" : "0.3.9"
          },
          {
            "id" : "8918A5F9-4693-4285-A10B-D702E877E9B4",
            "name" : "DebugSwiftUI",
            "url" : "https://github.com/anconaesselmann/DebugSwiftUI",
            "version" : "0.0.1"
          }
        ]
      }
    
  • Project:

    • Targets: "MyApp", "MyAppTests", "MyAppUITests".
    • Package Dependencies: none
Command:
// R1:
init -d LoadableView

// R2:
init -d LoadableView, -d MyAppUITests
Outcome:
  • Project directory

    spmfile (JSON) with one target and one/two dependencies is generated
      {
        "dependencies" : [
          {
            "id" : "8918A5F9-4693-4285-A10B-D702E877E9B4",
            "name" : "DebugSwiftUI",
            "url" : "https://github.com/anconaesselmann/DebugSwiftUI",
            "version" : "0.0.1"
          },
          {
            "id" : "AA39C307-0F4C-4482-916E-23D715D7BE8A",
            "name" : "LoadableView",
            "url" : "https://github.com/anconaesselmann/LoadableView",
            "version" : "0.3.9"
          }
        ],
        "targets" : [
          {
            "dependencies" : [
              "DebugSwiftUI",
              "LoadableView"
            ],
            "id" : "9D6FC795-45A9-457C-919F-D8CE20A9DFDA",
            "name" : "MyApp"
          }
        ]
      }
    

INIT_JSONC_T1_D0:

	dependencies resolved from dependencies file, dependencies stored in JSON spmfile	
	- [x] 
	- [x]   	/L1/L2/L1R1
	- [x] INIT_JSONC_OPT_T1_R1/R2 dependencies not stored in spmfile INIT-JSPM-T1-DEP-G0/1/2    INIT_JSONC_OPT_T1_R1/R2/L1/L2/L1R1
- [x] 1, 2 remote dependencies from xproj file 							INIT_JSON_PRJ_T1_R1/R2/L1/L2/L1R1
	- [x] dependencies stored in spmfile INIT-JSPM-T1-XPROJ-L1/2
	- [x] dependencies not stored in spmfile INIT-JSPM-T1-XPROJ-G1/2
- [ ] 1, 2 local dependencies from xproj file
	- [x] dependencies stored in spmfile INIT-JSPM-T1-XPROJ_DL-L1/2
	- [ ] dependencies not stored in spmfile INIT-JSPM-T1-XPROJ-LD-G1/2
- [ ] mix of local and remote dependencies from xproj file
	- [ ] dependencies stored in spmfile INIT-JSPM-T1-XPROJ_MD-L2
	- [ ] dependencies not stored in spmfile INIT-JSPM-T1-XPROJ-MD-G2
  • Multi target
    • same as one target

CSV spmfile

  • One target

    • 0, 1, 2 dependencies resolved from global dependencies file
  • Multi target

    • same as one target
    • targets have different dependencies
  • Regular and Test target

    • same as one target
    • targets have different dependencies

install command

JSON spmfile

  • One target INST-JSPM-T1
    • 1, 2 dependencies resolved from global dependencies file
      • Remote dependencies stored in spmfile INST-JSPM-T1-LD1/2
      • Remote dependencies not stored in spmfile INST-JSPM-T1-G1/2
      • Local dependencies stored in spmfile INST-JSPM-T1-LD1/2

CSV spmfile

  • One target INST-CSPM-T1
    • 1, 2 dependencies resolved from global dependencies file INST-CSPM-T1-D1/2

Glossary

Command: INIT: init INST: install

spmfile type: JSON: JSON spmfile JSONC: compact JSON spmfile (no dependency definition) CSV: CSV spmfile

Source: SPM: Dependency as declared in spmfile PRJ: Already present in the project file OPT: Passed in as an option to the command

Targets: T1: One none-test target T2S: Two none-test targets with the same dependencies T2D: Two none-test targets with different dependencies T1T: One none-test target and a test target with different dependencies

Dependency origin D0: 0 dependencies L1: 1 local dependency L2: 2 local dependencies R1: 1 local dependency R2: 2 local dependencies L1R1: 1 local and one remote dependency

Flags INIT F_G - Global dependencies F_CSV - CSV

Options O_FILE

⚠️ **GitHub.com Fallback** ⚠️