emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/drupal-mode b8863a5c82 054/308: Added first take on automa


From: ELPA Syncer
Subject: [nongnu] elpa/drupal-mode b8863a5c82 054/308: Added first take on automated tests.
Date: Tue, 25 Jan 2022 10:59:24 -0500 (EST)

branch: elpa/drupal-mode
commit b8863a5c8215aa45d677db23c5ef9bb1b1757944
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>

    Added first take on automated tests.
    
    Automated tests using Emacs Lisp Regression Testing (ERT).
---
 Makefile        |  5 ++++-
 drupal-tests.el | 29 +++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 00b0930b52..11641c69fa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: all clean install
+.PHONY: all test clean install
 
 ARCHIVE_NAME:=drupal-mode
 VERSION:=$(shell emacs --batch -l package --eval "(with-temp-buffer \
@@ -8,6 +8,9 @@ PACKAGE_NAME:=$(ARCHIVE_NAME)-$(VERSION)
 
 all: $(PACKAGE_NAME).tar
 
+test:
+       emacs --batch --user `whoami` -L `pwd` -l drupal-tests -f 
ert-run-tests-batch-and-exit
+
 $(ARCHIVE_NAME).info: README.md
        pandoc -t texinfo $^ | makeinfo -o $@
 
diff --git a/drupal-tests.el b/drupal-tests.el
new file mode 100644
index 0000000000..dadf37c541
--- /dev/null
+++ b/drupal-tests.el
@@ -0,0 +1,29 @@
+;;; drupal-tests.el --- ert tests for drupal-mode
+
+;;; Commentary:
+
+;; Drupal mode is an advanced minor mode for developing in Drupal.
+
+;;; Code:
+
+(require 'drupal-mode)
+(require 'ert)
+
+
+
+(ert-deftest drupal-major-version-test ()
+  "Test `drupal-major-version'."
+  (should (equal (drupal-major-version "7.12") "7"))
+  (should (equal (drupal-major-version "6.1") "6"))
+  (should (equal (drupal-major-version "4.5.2") "4.5"))
+)
+
+
+
+(provide 'drupal-tests)
+
+;; Local Variables:
+;; coding: utf-8
+;; End:
+
+;;; drupal-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]