Community
    • Login

    Setup to run unitTestLauncher.ps1

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 2 Posters 310 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • el-coder-sbE
      el-coder-sb
      last edited by

      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?

      EkopalypseE 2 Replies Last reply Reply Quote 1
      • EkopalypseE
        Ekopalypse @el-coder-sb
        last edited by

        @el-coder-sb

        Unexpected token “-export”

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

        1 Reply Last reply Reply Quote 0
        • EkopalypseE
          Ekopalypse @el-coder-sb
          last edited by

          @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

          1 Reply Last reply Reply Quote 1
          • el-coder-sbE
            el-coder-sb
            last edited by

            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?

            EkopalypseE 1 Reply Last reply Reply Quote 0
            • EkopalypseE
              Ekopalypse @el-coder-sb
              last edited by

              @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
              

              ??

              1 Reply Last reply Reply Quote 2
              • el-coder-sbE
                el-coder-sb
                last edited by

                @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!

                1 Reply Last reply Reply Quote 3
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors