Setup to run unitTestLauncher.ps1



  • I was asked to add a unitTest for added language to functionList.xml.
    (Add VHDL to functionList.xml #8509)

    But I can´t run unitTestLauncher.ps1 successfully. How do I do? (without building npp from source)

    What I did:
    I downloaded/cloned the current npp repo. I run unitTestLauncher.ps1 but this fails as there is only ‘Notepad++.exe.lastcodeanalysissucceeded’ instead of a real exe-file. OK.
    Then I changed the path in the ps-script to my current installed npp version but then it tells me:
    Unexpected token “-export”

    How do I do the right way to run it?



  • @el-coder-sb

    Unexpected token “-export”

    then I assume you are using an older version of npp, could this be?



  • @el-coder-sb

    just did a quick test.

    changed the path of my npp install in unitTestLauncher.ps1.
    Opened a cmd and opened powershell
    Run

    PS D:\Repositories\npp\PowerEditor\Test\FunctionList> .\unitTestLauncher.ps1
    

    resulted in multiple lines saying OK



  • I have 7.8.8 installed.

    I found that the “-export”-error was due to bad quotation marks.

    However now I get the error that the file “<path>\asm\unitTest.result.json” was not found.
    It is not generated (I cannot find it anywhere). Even when running with admin privileges.

    My first line in unitTestLauncher.ps1 is:

    "C:\Program Files\Notepad++\notepad++.exe -export=functionList -lasm .\asm\unitTest | Out-Null"
    

    Even when changing ".\asm\unitTest " to a full path there is no generated file.

    Where am I wrong?
    As I cannot find ‘-export’ at https://npp-user-manual.org/docs/command-prompt/ may be it is not supported by the standard installation?



  • @el-coder-sb said in Setup to run unitTestLauncher.ps1:

    However now I get the error that the file “<path>\asm\unitTest.result.json” was not found.

    Hmm, certainly works for me. Can you describe in more detail what you do and get? Show us the real results from cmd?

    Could it be that it must be quoted like

    "C:\Program Files\Notepad++\notepad++.exe" -export=functionList -lasm .\asm\unitTest | Out-Null
    

    ??



  • @Ekopalypse Thanks for your help and motivating me to go some steps further!

    I got it:

    I changed my setup to:

    C:\notepad-plus-plus-master <- where I copied the current Notepad++ clone
    C:\npp_7_8_8_bin_x64 <- where the latest realese was unzipped

    This makes it possible to put the path in unitTestLauncher.ps1 without quotation marks (your proposal did not work as this was what caused the “unexpected token”-error), as there is no space in the path (due to Windows “Program Files” -> bad Microsoft!).

    Now my first line in unitTestLauncher.ps1 is:

    C:\npp_7_8_8_bin_x64\notepad++.exe -export=functionList -lasm .\asm\unitTest | Out-Null
    

    BTW: I get onlly 2x “OK” as the bash test fails. But that´s another story.

    Now I can go on with the VHDL unittest! Thanks for your help!


Log in to reply