Skip to content

Commit 718aa1e

Browse files
committed
Meta: Update makem.sh
1 parent b7e1468 commit 718aa1e

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

makem.sh

+21-1
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,23 @@ function files_args {
248248
done
249249
}
250250

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+
251268
function dependencies {
252269
# Echo list of package dependencies.
253270
egrep '^;; Package-Requires: ' $(project-source-files) $(project-test-files) \
@@ -451,12 +468,14 @@ function lint-package {
451468
}
452469

453470
function tests {
454-
# Run tests.
471+
verbose 1 "Running all tests..."
472+
455473
test-ert
456474
test-buttercup
457475
}
458476

459477
function test-buttercup {
478+
buttercup-tests-p || return 0
460479
compile || die
461480

462481
verbose 1 "Running Buttercup tests..."
@@ -473,6 +492,7 @@ function test-buttercup {
473492
}
474493

475494
function test-ert {
495+
ert-tests-p || return 0
476496
compile || die
477497

478498
verbose 1 "Running ERT tests..."

0 commit comments

Comments
 (0)