Commit Graph

12 Commits

Author SHA1 Message Date
Zoltan Somogyi
474035d884 Use test instead of [] in sh code. 2021-03-06 21:52:19 +11:00
Zoltan Somogyi
1f45f91886 Make "mmake runtests" work again.
My commit afe2887882 broke the ability
to run the test suite outside of a bootcheck by executing "mmake runtests"
in the tests directory. This diff fixes that.

tests/Mmake.common:
    Don't define "TESTS_DIR = ..". While every single tests/*/Mmakefile
    defined it as such, I overlooked the fact that tests/Mmakefile itself
    defined it ".", referring to the same directory from a different starting
    point. Document this easily-overlooked fact.

    Rename the old runtests target, which after afe2887 runs the tests
    in a single directory, as runtests_dir, to leave the target name
    "runtests" itself free for tests/Mmakefile to use.

tests/Mmakefile:
    Define "TESTS_DIR = .", and add a target "runtests" which invokes
    "mmake runtests_dir" in each test directory.

tools/bootcheck:
    Invoke "mmake runtests_dir" instead of "mmake runtests" in each
    test directory.

    Initialize a variable just before it is used.

tests/*/Mmakefile:
    Add back the definition "TESTS_DIR = .."
2020-06-10 01:05:15 +10:00
Zoltan Somogyi
afe2887882 Remove stale references to test subdirs.
A long time ago, test directories such as hard_coded had subdirectories
such as hard_coded/typeclasses. These have since been flattened out
(e.g. hard_coded/typeclasses is now just typeclasses), but there were
still remnants of the old approach. This diff deletes those remnants.

tests/*/Mmakefile:
    Delete the TESTS_DIR and the SUBDIRS mmake variables; TESTS_DIR
    was always set to "..", and SUBDIRS to the empty string.

    Delete any references to the make variable NOT_WORKING, since
    it is never used.

tests/Mmake.common:
    Document that Mmakefiles in test directories don't have to set
    TESTS_DIR and SUBDIRS anymore. Fix the formatting of the documentation
    of the make variables they do still have to set.

    Delete the targets and actions for handling subdirectories of
    test directories, since there aren't any.

tests/Mmakefile:
    Simplify some code.
2020-04-14 11:23:12 +10:00
Zoltan Somogyi
8a764392d9 Avoid warnings from make in test directories.
tests/Mmake.common:
    Don't invoke any actions in the clean_local and realclean_local
    targets, since if using mmc --make, the builtin mmake rules
    have actions for those targets as well, and make can't handle
    more than one action for a target having actions. Replace those
    actions with dependencies on other, unique targets that have
    the actions instead.

tests/*/Mmakefile:
    Avoid actions in clean_local and realclean_local targets the same way.

    Sort the test names in some directories that didn't already do so.

    Delete some obsolete comments.

    Fix style.

tests/valid/Mmake.valid.common:
    As for the Mmakefiles above, and also move the definition of a make
    variable before it is needed.
2015-09-08 05:57:53 +10:00
Zoltan Somogyi
73f0a36719 Allow the use of -jN in many test directories.
tests/Mmake.common:
    Replace the -j1 in the runtests_local target used by all the test
    directories with $(MAYBE_J1).

tests/*/Mmakefile:
    Define MAYBE_J1 it as the empty string in test directories in which
    different tests don't share source files.

    Define MAYBE_J1 as -j1 in test directories in which
    different tests do share source files.

tests/submodules/sub2_a.m:
    Add this copy of sub_a.m to allow tests in the submodules directory
    to be done in parallel.

tests/submodules/accessibility2.m:
    Import sub2_a.m instead of sub_a.m.

tests/warnings/ambig_types_high_level.m:
    Add this copy of ambig_types.m to allow tests in the warnings directory
    to be done in parallel.

tests/warnings/ambig_high_level.m:
    Import ambig_types_high_level.m instead of ambig_types.m.
2015-02-19 06:02:45 +11:00
Zoltan Somogyi
aa60524d71 Eliminate redundant output from tools/bootcheck.
runtime/mercury_goto.h:
    Cast the "const MR_LabelLayout *" argument of calls
    MR_insert_internal_label, since without this cast, we get C compiler
    warnings in the bootcheck output when the caller passes a
    "const MR_LabelLayoutNoVarInfo *" for this argument.

tests/hard_coded/Mmakefile:
    Redirect the output of the weak_ptr test to a file instead of including it
    in the output of bootcheck itself. The output is maybe be needed in a rare
    cases, but is not needed most of the time.

tests/hard_coded/weak_ptr.m:
    Fix white space.

tests/feedback/Mmakefile:
    Specify verbosity level 0 when invoking mdprof_create_feedback.

deep_profiling/mdprof_create_feedback.m:
    Record the verbosity level when we postprocess the options. We used to
    record it *after* creating the feedback file, and before printing the
    messages gathered during this process. This *mostly* worked, but some
    messages are printed using trace goals *during* the creation of the
    feedback file, and these ignored the specified verbosity level.

deep_profiling/query.m:
    Remove the IO arguments from exec and try_exec, since they do not use them.

deep_profiling/var_use_analysis.m:
    Eliminate some ambiguities by renaming two predicates.

    Simplify some overly complex code.

deep_profiling/autopar_costs.m:
deep_profiling/create_report.m:
deep_profiling/mdprof_cgi.m:
deep_profiling/mdprof_test.m:
    Conform to the above changes.

mdbcomp/feedback.m:
    Fix a typo.
2015-01-22 02:18:08 +11:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Julien Fischer
b635ebf80b Convert .cvsignore -> .gitignore files in tests directory.
tests/*/.cvsignore:
    As above.

library/.gitignore:
    Ignore files generated by the namespace cleanliness check.
2013-01-07 14:33:25 +11:00
Zoltan Somogyi
593ebef300 Fix formatting.
Estimated hours taken: 0.1
Branches: main

tests/feedback/Mmakefile:
	Fix formatting.
2012-10-23 01:22:18 +00:00
Paul Bone
9da8d34dc7 Update expected test output due to changes in the best parallelisation search
algorithm.

The new code does not adjust the borders of the parallelisations, so our
previous test data differs from this test data in that respect.  The new code
also seems to have fixed a problem that affected the recorded goal paths.

tests/feedback/autopar_mandelbrot.exp:
tests/feedback/autopar_mmc.exp:
    As above.
2012-04-04 05:24:22 +00:00
Paul Bone
66176a407e The feedback tests on goliath were failing. The problem is that the test suite
is run without first building the workspace and the mdprof_create_feedback and
mdprof_report_feedback tools are not available.

tests/feedback/Mmakefile:
    Fix the test case failure by using the mdprof feedback tools in PATH if the
    workspace has not been built.
2012-01-09 00:51:51 +00:00
Paul Bone
7f39309eb2 Create test cases for feedback analysis.
These test cases take a program's profile and compute from it a feedback file.
Then pretty-print the feedback file using mdprof_report_feedback, and compare
the pretty-printed output to a reference output.  By comparing the pretty
printed output it's easy to see what has changed when the tests fail.

tests/Mmakefile:
tests/feedback:
    Create feedback directory in the test suite.

tests/feedback/Mmakefile:
tests/feedback/autopar_mandelbrot.exp:
tests/feedback/autopar_mmc.exp:
tests/feedback/mandelbrot/Deep.data:
tests/feedback/mandelbrot/Deep.procrep:
tests/feedback/mmc/Deep.data:
tests/feedback/mmc/Deep.procrep:
    Create two test cases for feedback analysis, these test the automatic
    parallelization of the compiler and mandelbrot program.

deep_profiler/mdprof_create_feedback.m:
    The create feedback tool does not generate a report by default.
2011-12-05 05:58:07 +00:00