Skip to content

Setup ​

Preview

Testing and the related agent skills are a preview feature. Details may change as we refine them.

There isn't a one-click installer for testing. You have two ways to get set up: let an agent do it, or use the extension's commands and follow the manual steps below.

Configuration Files ​

Three files at the root of a folder control how the extension treats your IDL code. All of them have JSON schemas, so VS Code provides hover help, validation, and auto-complete while you edit.

FilePurpose
idlpackage.jsonPackage metadata and dependencies for the IDL Package Manager (IPM)
idlformat.jsonCode formatting and style
idltest.jsonHow tests are found and run. See Configuration

Option 1: Use Commands ​

Open the command palette (Ctrl + Shift + P) and run any of these. Each one prompts for the workspace folder and never overwrites an existing file:

  • IDL: Initialize Package Config creates idlpackage.json
  • IDL: Initialize Formatting Config creates idlformat.json
  • IDL: Initialize Test Config creates idltest.json

Pro Tip

You don't need to write idlpackage.json by hand. Use the command above, or ask an agent to generate it for you (see below).

Option 2: Ask an Agent ​

IDL Agent has skills that handle the setup for you:

SkillWhat it does
idl-init-packageCreates idlpackage.json, idlformat.json, and idltest.json, a src folder, run-tests.pro, and .gitignore entries
idl-test-setupPrepares a repository to write and run tests: IDL's path, test layout, idltest.json, and the runner
idl-write-testsWrites spec files with Luna and explains the output
idl-run-testsRuns a spec or the whole suite and summarizes failures

Example prompts:

  • "Initialize this folder as a new IDL package called MyPackage"
  • "Set up testing for this repository"

Manual Steps ​

If you'd rather set things up yourself, the agent skills follow these steps.

  1. Choose a layout. Spec files end in .spec.pro and live next to the code:

    my-repo/
      idltest.json
      run-tests.pro
      src/
        my_routine.pro
        my_routine.spec.pro
  2. Create idltest.json at the root (or use the command above). See Configuration.

  3. Create run-tests.pro next to idltest.json:

    idl
    compile_opt idl2
    
    ; create test class - next to idltest.json
    s = sol()
    
    ; run all tests
    status = s.runTests()
    
    ; write summary to disk
    s.generateTestSummary
    
    end
  4. Ignore generated files. Add these to .gitignore:

    *spec.pro.log
    *idl.test.log
    *idltest.log
  5. Add your first spec and run it.

Licensed under MIT.