# HG changeset patch # User John W. Eaton # Date 1360463755 18000 # Node ID 1af8d21608b736fe25ffc51dd4c070292e61d2d6 # Parent b8157404614f272dd978cae48bbdb969de082117 rename all test files in the test directory from test_X.m to X.tst * Use - instead of _ for .tst file names. Fix all file lists in module.mk and Makefile.am files. * __run_test_suite__.m: Adapt to new naming convention. diff --git a/scripts/testfun/__run_test_suite__.m b/scripts/testfun/__run_test_suite__.m --- a/scripts/testfun/__run_test_suite__.m +++ b/scripts/testfun/__run_test_suite__.m @@ -23,8 +23,8 @@ function __run_test_suite__ (fcndirs, fixedtestdirs) testsdir = octave_config_info ("octtestsdir"); - libinterptestdir = fullfile (testsdir, "libinterp") - liboctavetestdir = fullfile (testsdir, "liboctave") + libinterptestdir = fullfile (testsdir, "libinterp"); + liboctavetestdir = fullfile (testsdir, "liboctave"); fixedtestdir = fullfile (testsdir, "fixed"); fcnfiledir = octave_config_info ("fcnfiledir"); if (nargin == 0) @@ -194,13 +194,12 @@ chdir (d); for i = 1:length (lst) nm = lst(i).name; - if (length (nm) > 5 && strcmp (nm(1:5), "test_") - && strcmp (nm((end-1):end), ".m")) + if (length (nm) > 4 && strcmp (nm((end-3):end), ".tst")) p = n = xf = sk = 0; ffnm = fullfile (d, nm); if (has_tests (ffnm)) print_test_file_name (nm); - [p, n, xf, sk] = test (nm(1:(end-2)), "quiet", fid); + [p, n, xf, sk] = test (nm, "quiet", fid); print_pass_fail (n, p); files_with_tests(end+1) = ffnm; ##elseif (has_demos (ffnm)) @@ -244,8 +243,10 @@ continue endif f = fullfile (d, nm); - if ((length (nm) > 2 && strcmp (nm((end-1):end), ".m")) || - (length (nm) > 4 && strcmp (nm((end-3):end), "-tst"))) + if ((length (nm) > 2 && strcmp (nm((end-1):end), ".m")) + || (length (nm) > 4 + && (strcmp (nm((end-3):end), "-tst") + || strcmp (nm((end-3):end), ".tst")))) p = n = xf = 0; ## Only run if it contains %!test, %!assert %!error or %!warning if (has_tests (f)) diff --git a/test/Makefile.am b/test/Makefile.am --- a/test/Makefile.am +++ b/test/Makefile.am @@ -22,33 +22,33 @@ FCN_FILES = \ fntests.m \ - test_args.m \ - test_bug_31371.m \ - test_diag_perm.m \ - test_error.m \ - test_eval-catch.m \ - test_for.m \ - test_func.m \ - test_global.m \ - test_if.m \ - test_index.m \ - test_io.m \ - test_line_continue.m \ - test_logical_index.m \ - test_null_assign.m \ - test_parser.m \ - test_prefer.m \ - test_range.m \ - test_recursion.m \ - test_return.m \ - test_slice.m \ - test_struct.m \ - test_switch.m \ - test_system.m \ - test_transpose.m \ - test_try.m \ - test_unwind.m \ - test_while.m + args.tst \ + bug-31371.tst \ + diag-perm.tst \ + error.tst \ + eval-catch.tst \ + for.tst \ + func.tst \ + global.tst \ + if.tst \ + index.tst \ + io.tst \ + line-continue.tst \ + logical-index.tst \ + null-assign.tst \ + parser.tst \ + prefer.tst \ + range.tst \ + recursion.tst \ + return.tst \ + slice.tst \ + struct.tst \ + switch.tst \ + system.tst \ + transpose.tst \ + try.tst \ + unwind.tst \ + while.tst include bug-35448/module.mk include bug-36025/module.mk @@ -59,31 +59,34 @@ include fcn-handle-derived-resolution/module.mk include nest/module.mk -check: test_sparse.m test_bc_overloads.m +check: sparse.tst bc-overload-tests.stamp $(top_builddir)/run-octave --norc --silent --no-history $(srcdir)/fntests.m $(srcdir) -test_sparse.m: build_sparse_tests.sh - $(srcdir)/build_sparse_tests.sh +sparse.tst: build-sparse-tests.sh + $(srcdir)/build-sparse-tests.sh GENERATED_BC_OVERLOADS_DIRS := \ - $(shell $(srcdir)/build_bc_overload_tests.sh --list-dirs) + $(shell $(srcdir)/build-bc-overload-tests.sh --list-dirs) GENERATED_BC_OVERLOADS_FILES := \ - $(shell $(srcdir)/build_bc_overload_tests.sh --list-files) + $(shell $(srcdir)/build-bc-overload-tests.sh --list-files) -bc-overload-tests.stamp: build_bc_overload_tests.sh bc_overloads_expected - $(srcdir)/build_bc_overload_tests.sh $(srcdir)/bc_overloads_expected +bc-overload-tests.stamp: build-bc-overload-tests.sh bc-overloads-expected + $(srcdir)/build-bc-overload-tests.sh $(srcdir)/bc-overloads-expected touch $@ +BUILT_SOURCES = bc-overload-tests.stamp + EXTRA_DIST = \ - build_sparse_tests.sh \ - build_bc_overload_tests.sh \ - bc_overloads_expected \ + build-sparse-tests.sh \ + build-bc-overload-tests.sh \ + bc-overloads-expected \ build_bc_overloads_expected.m \ $(FCN_FILES) CLEANFILES = \ - test_sparse.m \ + sparse.tst \ + bc-overload-tests.stamp \ $(GENERATED_BC_OVERLOADS_FILES) DISTCLEANFILES = \ @@ -92,7 +95,7 @@ fixedtestsdir := $(octtestsdir)/fixed nobase_fixedtests_DATA = \ - test_sparse.m \ + sparse.tst \ $(GENERATED_BC_OVERLOADS_FILES) \ $(filter-out fntests.m, $(FCN_FILES)) diff --git a/test/test_args.m b/test/args.tst rename from test/test_args.m rename to test/args.tst diff --git a/test/test_bug_31371.m b/test/bug-31371.tst rename from test/test_bug_31371.m rename to test/bug-31371.tst diff --git a/test/bug-35448/test_bug_35448.m b/test/bug-35448/bug-35448.tst rename from test/bug-35448/test_bug_35448.m rename to test/bug-35448/bug-35448.tst diff --git a/test/bug-35448/module.mk b/test/bug-35448/module.mk --- a/test/bug-35448/module.mk +++ b/test/bug-35448/module.mk @@ -2,6 +2,6 @@ bug-35448/fA.m \ bug-35448/fB.m \ bug-35448/fC.m \ - bug-35448/test_bug_35448.m + bug-35448/bug-35448.tst FCN_FILES += $(bug_35448_FCN_FILES) diff --git a/test/bug-36025/test_bug_36025.m b/test/bug-36025/bug-36025.tst rename from test/bug-36025/test_bug_36025.m rename to test/bug-36025/bug-36025.tst diff --git a/test/bug-36025/module.mk b/test/bug-36025/module.mk --- a/test/bug-36025/module.mk +++ b/test/bug-36025/module.mk @@ -2,6 +2,6 @@ bug-36025/@testclass/one.m \ bug-36025/@testclass/testclass.m \ bug-36025/@testclass/two.m \ - bug-36025/test_bug_36025.m + bug-36025/bug-36025.tst FCN_FILES += $(bug_36025_FCN_FILES) diff --git a/test/bug-38236/test_bug_38236.m b/test/bug-38236/bug-38236.tst rename from test/bug-38236/test_bug_38236.m rename to test/bug-38236/bug-38236.tst diff --git a/test/bug-38236/module.mk b/test/bug-38236/module.mk --- a/test/bug-38236/module.mk +++ b/test/bug-38236/module.mk @@ -1,6 +1,6 @@ bug_38236_FCN_FILES = \ bug-38236/df_vr.m \ bug-38236/u_vr.m \ - bug-38236/test_bug_38236.m + bug-38236/bug-38236.tst FCN_FILES += $(bug_38236_FCN_FILES) diff --git a/test/build-bc-overload-tests.sh b/test/build-bc-overload-tests.sh --- a/test/build-bc-overload-tests.sh +++ b/test/build-bc-overload-tests.sh @@ -40,7 +40,7 @@ case "$1" in --list-files) echo tbcover.m - echo test_bc_overloads.m + echo bc-overloads.tst for class in $CLASSES; do echo @$class/tbcover.m done @@ -87,7 +87,7 @@ exit fi -cat > test_bc_overloads.m << EOF +cat > bc-overloads.tst << EOF ## !!! DO NOT EDIT !!! ## THIS IS AN AUTOMATICALLY GENERATED FILE ## modify build_bc_overload_tests.sh to generate the tests you need. @@ -113,7 +113,7 @@ cat $expected_results_file | \ while read cl1 cl2 clr ; do - cat >> test_bc_overloads.m << EOF + cat >> bc-overloads.tst << EOF %% Name call %!assert (tbcover (ex.$cl1, ex.$cl2), "$clr") %% Handle call @@ -122,7 +122,7 @@ EOF done -cat >> test_bc_overloads.m << EOF +cat >> bc-overloads.tst << EOF %%test handles through cellfun %!test %! f = fieldnames (ex); diff --git a/test/build-sparse-tests.sh b/test/build-sparse-tests.sh --- a/test/build-sparse-tests.sh +++ b/test/build-sparse-tests.sh @@ -22,12 +22,12 @@ # Search for "# fails" # ./build_sparse_tests.sh preset -# creates test_sparse.m with preset tests. -# Use "test test_sparse" from octave to run the tests. +# creates sparse.tst with preset tests. +# Use "test sparse.tst" from octave to run the tests. # # ./build_sparse_tests.sh random -# Creates test_sprandom.m with randomly generated matrices. -# Use "test test_sprandom" from octave to run the tests. +# Creates sprandom.tst with randomly generated matrices. +# Use "test sprandom.tst" from octave to run the tests. # build_sparse_tests.sh generates tests for real and complex sparse matrices. # Also, we want to run both fixed tests with known outputs (quick tests) @@ -114,9 +114,9 @@ esac if $preset; then - TESTS=test_sparse.m + TESTS=sparse.tst else - TESTS=test_sprandom.m + TESTS=sprandom.tst fi # create initial file @@ -238,7 +238,7 @@ ## run preset sparse tests. All should pass. function [passes, tests] = test_sparse disp ("writing test output to sptest.log"); - test ("test_sparse", "normal", "sptest.log"); + test ("sparse.tst", "normal", "sptest.log"); endfunction EOF @@ -258,7 +258,7 @@ warning ("untested --- fix the source in build_sparse_tests.sh"); disp ("appending test output to sprandomtest.log"); fid = fopen ("sprandomtest.log", "at"); - test ("test_sprandom", "normal", fid); + test ("sprandom.tst", "normal", fid); ##[passes, total] = test("sprandomtest","normal",fid); fclose (fid); endfunction diff --git a/test/class-concat/test_class_concat.m b/test/class-concat/class-concat.tst rename from test/class-concat/test_class_concat.m rename to test/class-concat/class-concat.tst diff --git a/test/class-concat/module.mk b/test/class-concat/module.mk --- a/test/class-concat/module.mk +++ b/test/class-concat/module.mk @@ -1,5 +1,5 @@ class_concat_FCN_FILES = \ class-concat/@foo/foo.m \ - class-concat/test_class_concat.m + class-concat/class-concat.tst FCN_FILES += $(class_concat_FCN_FILES) diff --git a/test/classes/test_classes.m b/test/classes/classes.tst rename from test/classes/test_classes.m rename to test/classes/classes.tst --- a/test/classes/test_classes.m +++ b/test/classes/classes.tst @@ -162,7 +162,7 @@ %!test drk = Dork(); % Precedence. %! assert (isequal (bling (drk, prk), 2)); %! assert (isequal (bling (prk, drk), 2)); - + %% The Gork class tests aggregation and multiple inheritance. %!shared grk %!test grk = Gork(); diff --git a/test/classes/module.mk b/test/classes/module.mk --- a/test/classes/module.mk +++ b/test/classes/module.mk @@ -79,6 +79,6 @@ classes/@Spork/private/myStash.m \ classes/@Spork/saveobj.m \ classes/@Spork/set.m \ - classes/test_classes.m + classes/classes.tst FCN_FILES += $(classes_FCN_FILES) diff --git a/test/ctor-vs-method/test_ctor_vs_method.m b/test/ctor-vs-method/ctor-vs-method.tst rename from test/ctor-vs-method/test_ctor_vs_method.m rename to test/ctor-vs-method/ctor-vs-method.tst diff --git a/test/ctor-vs-method/module.mk b/test/ctor-vs-method/module.mk --- a/test/ctor-vs-method/module.mk +++ b/test/ctor-vs-method/module.mk @@ -6,6 +6,6 @@ ctor-vs-method/@parent/method.m \ ctor-vs-method/@parent/parent.m \ ctor-vs-method/__trace__.m \ - ctor-vs-method/test_ctor_vs_method.m + ctor-vs-method/ctor-vs-method.tst FCN_FILES += $(ctor_vs_method_FCN_FILES) diff --git a/test/test_diag_perm.m b/test/diag-perm.tst rename from test/test_diag_perm.m rename to test/diag-perm.tst diff --git a/test/test_error.m b/test/error.tst rename from test/test_error.m rename to test/error.tst diff --git a/test/test_eval-catch.m b/test/eval-catch.tst rename from test/test_eval-catch.m rename to test/eval-catch.tst diff --git a/test/fcn-handle-derived-resolution/test_fcn_handle_derived_resolution.m b/test/fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst rename from test/fcn-handle-derived-resolution/test_fcn_handle_derived_resolution.m rename to test/fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst diff --git a/test/fcn-handle-derived-resolution/module.mk b/test/fcn-handle-derived-resolution/module.mk --- a/test/fcn-handle-derived-resolution/module.mk +++ b/test/fcn-handle-derived-resolution/module.mk @@ -6,6 +6,6 @@ fcn-handle-derived-resolution/@other/other.m \ fcn-handle-derived-resolution/@parent/numel.m \ fcn-handle-derived-resolution/@parent/parent.m \ - fcn-handle-derived-resolution/test_fcn_handle_derived_resolution.m + fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst FCN_FILES += $(fcn_handle_derived_resolution_FCN_FILES) diff --git a/test/test_for.m b/test/for.tst rename from test/test_for.m rename to test/for.tst diff --git a/test/test_func.m b/test/func.tst rename from test/test_func.m rename to test/func.tst diff --git a/test/test_global.m b/test/global.tst rename from test/test_global.m rename to test/global.tst diff --git a/test/test_if.m b/test/if.tst rename from test/test_if.m rename to test/if.tst diff --git a/test/test_index.m b/test/index.tst rename from test/test_index.m rename to test/index.tst diff --git a/test/test_io.m b/test/io.tst rename from test/test_io.m rename to test/io.tst diff --git a/test/test_line_continue.m b/test/line-continue.tst rename from test/test_line_continue.m rename to test/line-continue.tst diff --git a/test/test_logical_index.m b/test/logical-index.tst rename from test/test_logical_index.m rename to test/logical-index.tst diff --git a/test/nest/module.mk b/test/nest/module.mk --- a/test/nest/module.mk +++ b/test/nest/module.mk @@ -1,4 +1,4 @@ -nest_FCN_FILES = \ +nest_fcn_files = \ nest/arg_nest.m \ nest/arg_ret.m \ nest/nest_eval.m \ @@ -13,7 +13,7 @@ nest/scope3.m \ nest/script_nest.m \ nest/script_nest_script.m \ - nest/test_nest.m \ + nest/nest.tst \ nest/varg_nest.m \ nest/varg_nest2.m diff --git a/test/nest/test_nest.m b/test/nest/nest.tst rename from test/nest/test_nest.m rename to test/nest/nest.tst diff --git a/test/test_null_assign.m b/test/null-assign.tst rename from test/test_null_assign.m rename to test/null-assign.tst diff --git a/test/test_parser.m b/test/parser.tst rename from test/test_parser.m rename to test/parser.tst diff --git a/test/test_prefer.m b/test/prefer.tst rename from test/test_prefer.m rename to test/prefer.tst diff --git a/test/test_range.m b/test/range.tst rename from test/test_range.m rename to test/range.tst diff --git a/test/test_recursion.m b/test/recursion.tst rename from test/test_recursion.m rename to test/recursion.tst diff --git a/test/test_return.m b/test/return.tst rename from test/test_return.m rename to test/return.tst diff --git a/test/test_slice.m b/test/slice.tst rename from test/test_slice.m rename to test/slice.tst diff --git a/test/test_struct.m b/test/struct.tst rename from test/test_struct.m rename to test/struct.tst diff --git a/test/test_switch.m b/test/switch.tst rename from test/test_switch.m rename to test/switch.tst diff --git a/test/test_system.m b/test/system.tst rename from test/test_system.m rename to test/system.tst diff --git a/test/test_transpose.m b/test/transpose.tst rename from test/test_transpose.m rename to test/transpose.tst diff --git a/test/test_try.m b/test/try.tst rename from test/test_try.m rename to test/try.tst diff --git a/test/test_unwind.m b/test/unwind.tst rename from test/test_unwind.m rename to test/unwind.tst diff --git a/test/test_while.m b/test/while.tst rename from test/test_while.m rename to test/while.tst