changeset 16030:1af8d21608b7

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.
author John W. Eaton <jwe@octave.org>
date Sat, 09 Feb 2013 21:35:55 -0500
parents b8157404614f
children 6076458ddf98
files scripts/testfun/__run_test_suite__.m test/Makefile.am test/args.tst test/bug-31371.tst test/bug-35448/bug-35448.tst test/bug-35448/module.mk test/bug-35448/test_bug_35448.m test/bug-36025/bug-36025.tst test/bug-36025/module.mk test/bug-36025/test_bug_36025.m test/bug-38236/bug-38236.tst test/bug-38236/module.mk test/bug-38236/test_bug_38236.m test/build-bc-overload-tests.sh test/build-sparse-tests.sh test/class-concat/class-concat.tst test/class-concat/module.mk test/class-concat/test_class_concat.m test/classes/classes.tst test/classes/module.mk test/classes/test_classes.m test/ctor-vs-method/ctor-vs-method.tst test/ctor-vs-method/module.mk test/ctor-vs-method/test_ctor_vs_method.m test/diag-perm.tst test/error.tst test/eval-catch.tst test/fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst test/fcn-handle-derived-resolution/module.mk test/fcn-handle-derived-resolution/test_fcn_handle_derived_resolution.m test/for.tst test/func.tst test/global.tst test/if.tst test/index.tst test/io.tst test/line-continue.tst test/logical-index.tst test/nest/module.mk test/nest/nest.tst test/nest/test_nest.m test/null-assign.tst test/parser.tst test/prefer.tst test/range.tst test/recursion.tst test/return.tst test/slice.tst test/struct.tst test/switch.tst test/system.tst test/test_args.m test/test_bug_31371.m test/test_diag_perm.m test/test_error.m test/test_eval-catch.m test/test_for.m test/test_func.m test/test_global.m test/test_if.m test/test_index.m test/test_io.m test/test_line_continue.m test/test_logical_index.m test/test_null_assign.m test/test_parser.m test/test_prefer.m test/test_range.m test/test_recursion.m test/test_return.m test/test_slice.m test/test_struct.m test/test_switch.m test/test_system.m test/test_transpose.m test/test_try.m test/test_unwind.m test/test_while.m test/transpose.tst test/try.tst test/unwind.tst test/while.tst
diffstat 47 files changed, 72 insertions(+), 68 deletions(-) [+]
line wrap: on
line diff
--- 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))
--- 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))
 
rename from test/test_args.m
rename to test/args.tst
rename from test/test_bug_31371.m
rename to test/bug-31371.tst
rename from test/bug-35448/test_bug_35448.m
rename to test/bug-35448/bug-35448.tst
--- 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)
rename from test/bug-36025/test_bug_36025.m
rename to test/bug-36025/bug-36025.tst
--- 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)
rename from test/bug-38236/test_bug_38236.m
rename to test/bug-38236/bug-38236.tst
--- 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)
--- 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);
--- 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
rename from test/class-concat/test_class_concat.m
rename to test/class-concat/class-concat.tst
--- 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)
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();
--- 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)
rename from test/ctor-vs-method/test_ctor_vs_method.m
rename to test/ctor-vs-method/ctor-vs-method.tst
--- 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)
rename from test/test_diag_perm.m
rename to test/diag-perm.tst
rename from test/test_error.m
rename to test/error.tst
rename from test/test_eval-catch.m
rename to test/eval-catch.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
--- 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)
rename from test/test_for.m
rename to test/for.tst
rename from test/test_func.m
rename to test/func.tst
rename from test/test_global.m
rename to test/global.tst
rename from test/test_if.m
rename to test/if.tst
rename from test/test_index.m
rename to test/index.tst
rename from test/test_io.m
rename to test/io.tst
rename from test/test_line_continue.m
rename to test/line-continue.tst
rename from test/test_logical_index.m
rename to test/logical-index.tst
--- 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
 
rename from test/nest/test_nest.m
rename to test/nest/nest.tst
rename from test/test_null_assign.m
rename to test/null-assign.tst
rename from test/test_parser.m
rename to test/parser.tst
rename from test/test_prefer.m
rename to test/prefer.tst
rename from test/test_range.m
rename to test/range.tst
rename from test/test_recursion.m
rename to test/recursion.tst
rename from test/test_return.m
rename to test/return.tst
rename from test/test_slice.m
rename to test/slice.tst
rename from test/test_struct.m
rename to test/struct.tst
rename from test/test_switch.m
rename to test/switch.tst
rename from test/test_system.m
rename to test/system.tst
rename from test/test_transpose.m
rename to test/transpose.tst
rename from test/test_try.m
rename to test/try.tst
rename from test/test_unwind.m
rename to test/unwind.tst
rename from test/test_while.m
rename to test/while.tst