PreviousUpNext

15.4.1387  src/lib/x-kit/tut/xkit-tut-unit-test.pkg

## xkit-tut-unit-test.pkg

# Compiled by:
#     src/lib/test/unit-tests.lib


# Run by:
#     src/lib/test/all-unit-tests.pkg

stipulate
    include package   unit_test;                                                # unit_test             is from   src/lib/src/unit-test.pkg
    include package   makelib::scripting_globals;
    #
    package fil =  file__premicrothread;                                # file__premicrothread  is from   src/lib/std/src/posix/file--premicrothread.pkg
herein

    package xkit_tut_unit_test {
        #
        name = "src/lib/x-kit/tut/xkit-tut-unit-test.pkg";

log_if = fil::log_if  fil::compiler_logging  0;                 # Purely for debug narration.

        fun do selfcheck
            =
            {   (selfcheck ()) ->  { passed, failed };
                #
                for (i = 0; i < passed; ++i) {   assert TRUE;    };
                for (i = 0; i < failed; ++i) {   assert FALSE;   };
            };  

        fun run ()
            =
            {   printf "\nDoing %s:\n" name;   


                                                                fil::set_logger_to (fil::LOG_TO_FILE "xkit-tut-unit-test.log");
                                                                log_if {. "xkit_tut_unit_test/XYZZY/PLUGH"; };
                                                                log_if {. "xkit_tut_unit_test: running triangle app..."; };

                                                                # printf "\ntriangle_app...  -- xkit-tut-unit-test.pkg\n";
                do        triangle_app::selfcheck;              # triangle_app          is from   src/lib/x-kit/tut/triangle/triangle-app.pkg
                                                                log_if {. "xkit_tut_unit_test: running plaid app..."; };

                                                                # printf "\nplaid_app...  -- xkit-tut-unit-test.pkg\n";
                do           plaid_app::selfcheck;              # plaid_app             is from   src/lib/x-kit/tut/plaid/plaid-app.pkg
                                                                log_if {. "xkit_tut_unit_test: running nbody app..."; };

                                                                # printf "\nnbody_app...  -- xkit-tut-unit-test.pkg\n";
                do           nbody_app::selfcheck;              # nbody_app             is from   src/lib/x-kit/tut/nbody/nbody-app.pkg
                                                                log_if {. "xkit_tut_unit_test: running calculator app..."; };

                                                                # printf "\ncalculator_app...  -- xkit-tut-unit-test.pkg\n";
                do      calculator_app::selfcheck;              # calculator_app        is from   src/lib/x-kit/tut/calculator/calculator-app.pkg
                                                                log_if {. "xkit_tut_unit_test: running colormixer app..."; };

                                                                # printf "\ncolormixer_app...  -- xkit-tut-unit-test.pkg\n";
                do     colormixer_app::selfcheck;               # colormixer_app        is from   src/lib/x-kit/tut/colormixer/colormixer-app.pkg
                                                                log_if {. "xkit_tut_unit_test: running bouncing-heads app..."; };

                                                                # printf "\nbouncing_heads_app...  -- xkit-tut-unit-test.pkg\n";
                do  bouncing_heads_app::selfcheck;              # bouncing_heads_app    is from   src/lib/x-kit/tut/bouncing-heads/bouncing-heads-app.pkg
                                                                log_if {. "xkit_tut_unit_test: running arithmetic-game app..."; };

                                                                # printf "\narithmetic_game_app...  -- xkit-tut-unit-test.pkg\n";
                do arithmetic_game_app::selfcheck;              # arithmetic_game_app   is from   src/lib/x-kit/tut/arithmetic-game/arithmetic-game-app.pkg
                                                                log_if {. "xkit_tut_unit_test: running badbricks app..."; };

# Dropped 2012-12-22 because it locks up with redirected socket calls.
# This app has been so consistently misbehaved that I believe this is
# probably due to a bug in the game, possibly due to a bug in xkit, and
# almost certainly not due to a bug in the syscall-redirection logic;
# for the moment I want to concentrate on finishing the syscall-redirection
# project and more generally the conversion of Mythryl to concurrent-by-default,
# so I'm going to sweep this one under the rug for the moment.
#               do  badbricks_game_app::selfcheck;              # badbricks_game_app    is from   src/lib/x-kit/tut/badbricks-game/badbricks-game-app.pkg
#                                                               log_if {. "xkit_tut_unit_test: running show-graph app..."; };

                                                                # printf "\nshow_graph_app...  -- xkit-tut-unit-test.pkg\n";
                do      show_graph_app::selfcheck;              # show_graph_app        is from   src/lib/x-kit/tut/show-graph/show-graph-app.pkg
                                                                log_if {. "xkit_tut_unit_test: summarizing to stdout..."; };

                                                                # printf "\nsummarize_unit_test...  -- xkit-tut-unit-test.pkg\n";
                summarize_unit_tests  name;
                                                                log_if {. "xkit_tut_unit_test: Done."; };
            };
    };

end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext