Skip to content

Commit

Permalink
Add a test for mini init
Browse files Browse the repository at this point in the history
  • Loading branch information
peromage committed Sep 20, 2023
1 parent 04cd210 commit 605245e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ jobs:
- name: Test - Normal startup
run: ./pew/tests/test-init.sh $(pwd)

- name: Test - Mini startup
run: ./pew/tests/test-init-mini.sh $(pwd)

- name: Test - pewcfg unittests
run: ./pew/site-lisp/pewcfg/tests/run-tests.sh $(pwd)
20 changes: 20 additions & 0 deletions pew/tests/test-init-mini.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env -S emacs --batch --script
;;; test-init-mini.sh --- Test minimal startup -*- mode: emacs-lisp; lexical-binding: t; -*-
;;; Commentary:
;;; Code:

;;; Process arguments
(if (< (length argv) 1) (error "Not enough arguments"))
(setq repo-root-path (nth 0 argv))

;;; Test starts
(require 'url-vars)
(let* ((debug-on-error t)
(url-show-status nil)
(user-emacs-directory repo-root-path)
(user-init-file (expand-file-name "init-mini.el" user-emacs-directory))
(load-path (delq user-emacs-directory load-path)))
(load-file user-init-file)
(run-hooks 'after-init-hook)
(run-hooks 'emacs-startup-hook)
(message "%s started in %s" (emacs-version) (emacs-init-time)))

0 comments on commit 605245e

Please sign in to comment.