File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,23 @@ function files_args {
248
248
done
249
249
}
250
250
251
+ function buttercup-tests-p {
252
+ # Return 0 if Buttercup tests are found.
253
+ debug " Checking for Buttercup tests..."
254
+
255
+ grep " (require 'buttercup)" $( project-test-files) & > /dev/null
256
+ }
257
+
258
+ function ert-tests-p {
259
+ # Return 0 if ERT tests are found.
260
+ debug " Checking for ERT tests..."
261
+
262
+ # We check for this rather than "(require 'ert)", because ERT may
263
+ # already be loaded in Emacs and might not be loaded with
264
+ # "require" in a test file.
265
+ grep " (ert-deftest" $( project-test-files) & > /dev/null
266
+ }
267
+
251
268
function dependencies {
252
269
# Echo list of package dependencies.
253
270
egrep ' ^;; Package-Requires: ' $( project-source-files) $( project-test-files) \
@@ -451,12 +468,14 @@ function lint-package {
451
468
}
452
469
453
470
function tests {
454
- # Run tests.
471
+ verbose 1 " Running all tests..."
472
+
455
473
test-ert
456
474
test-buttercup
457
475
}
458
476
459
477
function test-buttercup {
478
+ buttercup-tests-p || return 0
460
479
compile || die
461
480
462
481
verbose 1 " Running Buttercup tests..."
@@ -473,6 +492,7 @@ function test-buttercup {
473
492
}
474
493
475
494
function test-ert {
495
+ ert-tests-p || return 0
476
496
compile || die
477
497
478
498
verbose 1 " Running ERT tests..."
You can’t perform that action at this time.
0 commit comments