Announcement

Collapse
No announcement yet.

PbUnit

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PbUnit

    I've made a small unit testing framework. You can download it here.

    The general steps are as follows:
    1) Create a base test file.
    2) Add unit test skeletons for routines.
    3) Write unit tests.
    4) Sequence unit tests.
    5) Generate a unit test application.
    6) Compile and run the generated unit test application.
    Some features are, tests are written in a separate file, user can use the pb/ide to make creating them easier, write shared setup/tear down code, two forms of assert (automatic message generation and coded message), generate stubs with call signatures for all routines in primary source file, sequence tests sharing a name, generate a test app. App can be run from the command line or with a built in GUI. Works with Pb CC 6 or Pb Win 10. Run with a single test or any group of tests. Scriptable or interactive.

    You can read more about it in the download docs or here.
    Last edited by Larry Charlton; 2 Sep 2012, 05:35 PM.
    LarryC
    Website
    Sometimes life's a dream, sometimes it's a scream

  • #2
    Released version 1.1. You can download it here. It functions very similar to version 1 with a few notable exceptions.

    The unit testing framework has been wrapped up in a class. This reduces the words reserved by the framework to 2: cPbUnitTest and pbUnitTestGui.

    Also pbuGui.dll was changed from using wait handles to using the inversion of control design pattern. The resulting code is a bit easier to read and follow.

    A application created with the framework and compiled with PbCC supports the /console command line switch to send output to the command line.

    Some other minor housekeeping items, fixed a bug, consolidated GUI and command line processing into a single routine.

    The url to read about it remains the same.
    LarryC
    Website
    Sometimes life's a dream, sometimes it's a scream

    Comment


    • #3
      Fixed a bug with relative path names, updated the display a bit and added a quick start guide as well as a short initial setup to make using it easier.



      LarryC
      Website
      Sometimes life's a dream, sometimes it's a scream

      Comment


      • #4
        Few bug fixes, affects multi-source projects. Also significantly increased the speed of running tests again.
        LarryC
        Website
        Sometimes life's a dream, sometimes it's a scream

        Comment


        • #5
          Fixed a few more bugs. Also added a small utility to assist with the process of unit testing. The utility will create a new Unit test file for you, add test stubs for any new routines, sequence tests, generate the test framework, compile it, and run it. Among it's configuration features it allows you to swtich between using PbWin and PbCC and between up to 4 sets of include directories. Below is a screen shot of the first page of the utility:
          LarryC
          Website
          Sometimes life's a dream, sometimes it's a scream

          Comment


          • #6
            v1.02

            Updated to allow adding class methods and instance variables to the test routine. You can also use the Create and Destroy class methods for overall test startup/teardown code.

            Put in a bit more error handling for configrations as well as more intuitive messages if something goes wrong running. Moved the initial opening of the TestBuilder to the bottom right of the primary monitor.

            PBUnit is built without needing PBSlice200.dll but it's included if you want to compile it to use it or want to make changes and have trouble getting it to compile inline.

            I think also from the last time, all the tests now default to selected on run, so if you just want to run the tests you just have to click the run button.

            Updated a bit of the documentation to reflect the changes.

            Edit: Forgot the new download here.
            Last edited by Larry Charlton; 5 Sep 2012, 06:32 PM.
            LarryC
            Website
            Sometimes life's a dream, sometimes it's a scream

            Comment


            • #7
              Added the ability to skip a test. See the readme for more information on how it's intended to be used.
              LarryC
              Website
              Sometimes life's a dream, sometimes it's a scream

              Comment


              • #8
                Updated pbUnit to prefix all internal instance variables with pbu. Should help reduce conflict with testing variables and application variables.

                The GUI was calculating pass rate incorrectly. It calculated passedAssertions / testCount. It now calculates passedAssertions / runAssertions. The # of tests is now totalAssertions as well. skippedAssertions remains the same.

                Also the begining of unit tests is in the src\PbSlice2.test file.


                Download latest here.
                LarryC
                Website
                Sometimes life's a dream, sometimes it's a scream

                Comment


                • #9
                  • Fixed minor bug with condition display. Changed parsing routine.
                  • Updated gui results to select first failed (or the last run test). Makes running repeated runs with incremental test writing easier.
                  • Gui results replaces Cr/Lf with ~. Makes displaying multi-line results possible to read. Test remains unchanged.
                  • pbUnit split Assert onto two lines to facilitate longer lines.
                  • pbUnit Added #Debug Error On And #Debug Display On to generated code to catch ignored errors, removed #Debug statements other than #Debug Print
                  Latest download is here.
                  LarryC
                  Website
                  Sometimes life's a dream, sometimes it's a scream

                  Comment


                  • #10
                    • Gui switching from one tag to another will no longer leave multiple tags highlighted.
                    • Allowed resource files to be included in tests. #Resource RcData, #, "filename"
                    • Documentation updates.
                    You can download from here.
                    LarryC
                    Website
                    Sometimes life's a dream, sometimes it's a scream

                    Comment


                    • #11
                      Minor GUI testing updates. I liked a comment the other day on a thread about reusing a dialog.
                      • Updated the test GUI to use a single dialog, eliminated some dialog/icon flicker, also faster.
                      • Enable/disable Run button based on selections
                      • Close from either screen closes test gui (Use done to return and change selections)
                      • Listview selections on initial screen are more consistent
                      • Preserved selected tests after run.
                      • Tag/Listview current items retained on returning from results screen.
                      You can download latest from here.
                      LarryC
                      Website
                      Sometimes life's a dream, sometimes it's a scream

                      Comment

                      Working...
                      X