apjanke / octave-testify

New BIST (Built-In Self Test) functions for GNU Octave
GNU General Public License v3.0
4 stars 2 forks source link

`runtests2 -pkg <pkgname>` should fail-fast if package is not loaded #91

Open apjanke opened 4 years ago

apjanke commented 4 years ago

If you try to runtests2 -pkg <pkgname> a package that isn't loaded, you'll just get spurious errors:

>> pkg install -forge ga
For information about changes from previous versions of the ga package, run 'news ga'.
>> runtests2 -pkg ga
  /Users/janke/Library/Application Support/Octave.app/4.4.1/pkg/ga-0.10.1/__ga_initial_population__.m  PASS      3/5
                                                                FAIL      2
  /Users/janke/Library/Application Support/Octave.app/4.4.1/pkg/ga-0.10.1/__ga_problem_update_state_at_each_generation__.m  PASS      1/1
  /Users/janke/Library/Application Support/Octave.app/4.4.1/pkg/ga-0.10.1/fitscalingrank.m error: 'fitscalingrank' undefined near line 1 column 16
>>

Not helpful! And it blows up!

runtests2 -pkg <foo> should check whether <foo> is loaded, and if not, error out immediately with an explanatory message.

apjanke commented 4 years ago

See https://github.com/octave-app/octave-app/issues/152, which was caused by this.