Mercurial > hg > octave-thorsten
changeset 13192:968e89b45bbf
move tests for classes into subdirectories
* classes/test_classes.m: Rename from test_classes.m.
* classes/module.mk: New file with contents from @Blork/module.mk,
@Dork/module.mk, @Pork/module.mk, @Snork/module.mk, @Cork/module.mk,
@Gork/module.mk, @Sneetch/module.mk, and @Spork/module.mk.
(classes_FCN_FILES): Include test_classes.m in the list.
* @Blork/module.mk, @Dork/module.mk, @Pork/module.mk,
@Snork/module.mk, @Cork/module.mk, @Gork/module.mk,
@Sneetch/module.mk, @Spork/module.mk: Delete.
* ctor-vs-method/test_ctor_vs_method.m: Rename from test_ctor_vs_method.m.
* ctor-vs-method/module.mk (ctor_vs_method_FCN_FILES): Include
test_ctor_vs_method.m in the list.
* test/Makefile.am (FCN_FILES): Remove test_classes.m and
test_ctor_vs_method.m from the list.
Don't include @Blork/module.mk,
@Dork/module.mk, @Pork/module.mk, @Snork/module.mk, @Cork/module.mk,
@Gork/module.mk, @Sneetch/module.mk, @Spork/module.mk.
Do include classes/module.mk and ctor-vs-method/module.mk.
* fntests.m (run_test_dir): Also skip private directories and
directories with names that begin with "@".
Work recursively. Change to test directory when running tests.
line wrap: on
line diff
deleted file mode 100644 --- a/test/@Blork/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -at_Blork_FCN_FILES = \ - @Blork/Blork.m \ - @Blork/bleek.m \ - @Blork/display.m \ - @Blork/get.m \ - @Blork/set.m - -FCN_FILES += $(at_Blork_FCN_FILES)
deleted file mode 100644 --- a/test/@Cork/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -at_Cork_FCN_FILES = \ - @Cork/Cork.m \ - @Cork/click.m \ - @Cork/display.m \ - @Cork/get.m \ - @Cork/set.m - -FCN_FILES += $(at_Cork_FCN_FILES)
deleted file mode 100644 --- a/test/@Dork/module.mk +++ /dev/null @@ -1,11 +0,0 @@ -at_Dork_FCN_FILES = \ - @Dork/Dork.m \ - @Dork/bling.m \ - @Dork/display.m \ - @Dork/gack.m \ - @Dork/get.m \ - @Dork/getStash.m \ - @Dork/set.m \ - @Dork/private/myStash.m - -FCN_FILES += $(at_Dork_FCN_FILES)
deleted file mode 100644 --- a/test/@Gork/module.mk +++ /dev/null @@ -1,11 +0,0 @@ -at_Gork_FCN_FILES = \ - @Gork/Gork.m \ - @Gork/cork.m \ - @Gork/display.m \ - @Gork/gark.m \ - @Gork/get.m \ - @Gork/set.m \ - @Gork/subsasgn.m \ - @Gork/subsref.m - -FCN_FILES += $(at_Gork_FCN_FILES)
deleted file mode 100644 --- a/test/@Pork/module.mk +++ /dev/null @@ -1,10 +0,0 @@ -at_Pork_FCN_FILES = \ - @Pork/Pork.m \ - @Pork/bling.m \ - @Pork/display.m \ - @Pork/get.m \ - @Pork/gurk.m \ - @Pork/set.m \ - @Pork/private/myStash.m - -FCN_FILES += $(at_Pork_FCN_FILES)
deleted file mode 100644 --- a/test/@Sneetch/module.mk +++ /dev/null @@ -1,5 +0,0 @@ -at_Sneetch_FCN_FILES = \ - @Sneetch/Sneetch.m \ - @Sneetch/display.m - -FCN_FILES += $(at_Sneetch_FCN_FILES)
deleted file mode 100644 --- a/test/@Snork/module.mk +++ /dev/null @@ -1,17 +0,0 @@ -at_Snork_FCN_FILES = \ - @Snork/Snork.m \ - @Snork/cack.m \ - @Snork/display.m \ - @Snork/end.m \ - @Snork/get.m \ - @Snork/getStash.m \ - @Snork/gick.m \ - @Snork/loadobj.m \ - @Snork/saveobj.m \ - @Snork/set.m \ - @Snork/subsasgn.m \ - @Snork/subsindex.m \ - @Snork/subsref.m \ - @Snork/private/myStash.m - -FCN_FILES += $(at_Snork_FCN_FILES)
deleted file mode 100644 --- a/test/@Spork/module.mk +++ /dev/null @@ -1,13 +0,0 @@ -at_Spork_FCN_FILES = \ - @Spork/Spork.m \ - @Spork/cack.m \ - @Spork/display.m \ - @Spork/geek.m \ - @Spork/get.m \ - @Spork/getStash.m \ - @Spork/loadobj.m \ - @Spork/saveobj.m \ - @Spork/set.m \ - @Spork/private/myStash.m - -FCN_FILES += $(at_Spork_FCN_FILES)
--- a/test/Makefile.am +++ b/test/Makefile.am @@ -23,9 +23,7 @@ FCN_FILES = \ fntests.m \ test_args.m \ - test_classes.m \ test_contin.m \ - test_ctor_vs_method.m \ test_diag_perm.m \ test_error.m \ test_eval-catch.m \ @@ -53,15 +51,7 @@ test_unwind.m \ test_while.m -include @Blork/module.mk -include @Cork/module.mk -include @Dork/module.mk -include @Gork/module.mk -include @Pork/module.mk -include @Sneetch/module.mk -include @Snork/module.mk -include @Spork/module.mk - +include classes/module.mk include ctor-vs-method/module.mk check: test_sparse.m test_bc_overloads.m
--- a/test/ctor-vs-method/module.mk +++ b/test/ctor-vs-method/module.mk @@ -5,6 +5,7 @@ ctor-vs-method/@other/parent.m \ ctor-vs-method/@parent/method.m \ ctor-vs-method/@parent/parent.m \ - ctor-vs-method/__trace__.m + ctor-vs-method/__trace__.m \ + test_ctor_vs_method.m FCN_FILES += $(ctor_vs_method_FCN_FILES)
--- a/test/fntests.m +++ b/test/fntests.m @@ -115,26 +115,45 @@ dp = dn = dxf = dsk = 0; for i = 1:length (lst) nm = lst(i).name; - if (length (nm) > 5 && strcmp (nm(1:5), "test_") - && strcmp (nm((end-1):end), ".m")) - 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); - print_pass_fail (n, p); - files_with_tests(end+1) = ffnm; - ##elseif (has_demos (ffnm)) - ## files_with_tests(end+1) = ffnm; - else - files_with_no_tests(end+1) = ffnm; - endif + if (lst(i).isdir + && ! strcmp (nm, ".") && ! strcmp (nm, "..") + && ! strcmp (nm, "private") && nm(1) != "@" + && ! strcmp (nm, "CVS")) + [p, n, xf, sk] = run_test_dir (fid, [d, "/", nm]); dp += p; dn += n; dxf += xf; dsk += sk; endif endfor + saved_dir = pwd (); + unwind_protect + 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")) + 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); + print_pass_fail (n, p); + files_with_tests(end+1) = ffnm; + ##elseif (has_demos (ffnm)) + ## files_with_tests(end+1) = ffnm; + else + files_with_no_tests(end+1) = ffnm; + endif + dp += p; + dn += n; + dxf += xf; + dsk += sk; + endif + endfor + unwind_protect_cleanup + chdir (saved_dir); + end_unwind_protect endfunction function [dp, dn, dxf, dsk] = run_test_script (fid, d);