-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds tests file b-examples.el and CI test script
- Loading branch information
1 parent
349fdad
commit 4e39164
Showing
7 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: b.el Tests | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
emacs_version: | ||
- 24.4 | ||
- 29.0 | ||
- snapshot | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Emacs | ||
uses: purcell/[email protected] | ||
with: | ||
version: ${{ matrix.emacs_version }} | ||
|
||
- name: Test | ||
run: | | ||
bin/setup.sh | ||
bin/tests.sh | ||
# docs: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - uses: purcell/[email protected] | ||
# with: | ||
# version: 28.1 | ||
# - name: Generate documentation | ||
# run: | | ||
# bin/setup.sh | ||
# echo " Test Doc generation..." | ||
# bin/docs.sh | ||
# echo "════════════════════════════════════════════════════════════════════════════════" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ | |
|
||
# Undo-tree save-files | ||
*.~undo-tree | ||
|
||
# macOS | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,8 @@ | |
|
||
;;; Code: | ||
|
||
;; Dependencies | ||
|
||
(require 'dash) ; Too damn convenient. | ||
|
||
;; Dec <-> Hex | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
etd="$(dirname "$(find ~/.emacs.d | grep "/etd.el$" | tail -1)")" | ||
dash="$(dirname "$(find ~/.emacs.d | grep "/dash.el$" | tail -1)")" | ||
|
||
cat <<INFO | ||
════════════════════════════════════════════════════════════════════════════════ | ||
_ _ | ||
| | | | | ||
| |__ ___| | | ||
| '_ \ / _ \ | | ||
| |_) | __/ | | ||
|_.__(_)___|_| | ||
_ | ||
| | | ||
__| | ___ ___ ___ | ||
/ _` |/ _ \ / __/ __| | ||
| (_| | (_) | (__\__ \\ | ||
\__,_|\___/ \___|___/ | ||
──────────────────────────────────────────────────────────────────────────────── | ||
Required packages present: | ||
ETD: $etd | ||
Dash: $dash | ||
════════════════════════════════════════════════════════════════════════════════ | ||
$(emacs --version) | ||
════════════════════════════════════════════════════════════════════════════════ | ||
INFO | ||
emacs --batch \ | ||
-eval "(add-to-list 'load-path \".\")" \ | ||
-eval "(add-to-list 'load-path \"${etd}\")" \ | ||
-eval "(add-to-list 'load-path \"${dash}\")" \ | ||
-l ert \ | ||
-l etd \ | ||
-l ./b.el \ | ||
-l ./dev/b-examples.el \ | ||
--eval "(message \"Update README.md\")" \ | ||
--eval "(etd-create-docs-file-for \"dev/b-examples.el\" \"dev/doc-template\" \"README.md\")" \ | ||
--eval "(message \"Update index.md\")" \ | ||
--eval "(etd-create-docs-file-for \"dev/b-examples.el\" \"dev/index-template\" \"index.md\")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh -e | ||
|
||
# For CI / Github Actions | ||
|
||
EMACS="${EMACS:=emacs}" | ||
|
||
NEEDED_PACKAGES="etd dash" | ||
|
||
INIT_PACKAGE_EL="(progn \ | ||
(require 'package) \ | ||
(push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) \ | ||
(package-initialize) \ | ||
(package-refresh-contents) \ | ||
(dolist (pkg '(${NEEDED_PACKAGES})) \ | ||
(unless (package-installed-p pkg) \ | ||
(package-install pkg))))" | ||
|
||
# Refresh package archives, because the test suite needs to see at least | ||
# package-lint and cl-lib. | ||
"$EMACS" -batch \ | ||
--eval "$INIT_PACKAGE_EL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
etd="$(dirname "$(find ~/.emacs.d | grep "/etd.el$" | tail -1)")" | ||
dash="$(dirname "$(find ~/.emacs.d | grep "/dash.el$" | tail -1)")" | ||
|
||
EMACS="${EMACS:=emacs}" | ||
|
||
cat <<INFO | ||
════════════════════════════════════════════════════════════════════════════════ | ||
_ _ | ||
| | | | | ||
| |__ ___| | | ||
| '_ \ / _ \ | | ||
| |_) | __/ | | ||
|_.__(_)___|_| | ||
_ _ | ||
| | | | | ||
| |_ ___ ___| |_ ___ | ||
| __/ _ \/ __| __/ __| | ||
| || __/\__ \ |_\__ \\ | ||
\__\___||___/\__|___/ | ||
──────────────────────────────────────────────────────────────────────────────── | ||
Required packages present: | ||
ETD: $etd | ||
Dash: $dash | ||
════════════════════════════════════════════════════════════════════════════════ | ||
$("$EMACS" --version) | ||
════════════════════════════════════════════════════════════════════════════════ | ||
INFO | ||
|
||
"$EMACS" --batch \ | ||
-eval "(add-to-list 'load-path \"${dash}\")" \ | ||
-eval "(add-to-list 'load-path \"${etd}\")" \ | ||
-eval "(add-to-list 'load-path \".\")" \ | ||
-l ert \ | ||
-l dash \ | ||
-l etd \ | ||
-l ./b.el \ | ||
-l ./dev/b-examples.el \ | ||
--eval "(ert-run-tests-batch-and-exit)" | ||
exitcode=$? | ||
|
||
echo " | ||
════════════════════════════════════════════════════════════════════════════════" | ||
exit $exitcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
;;; b-examples --- tests for b.el -*- lexical-binding: t; -*- | ||
|
||
;; Dependencies | ||
|
||
(require 'etd) | ||
(require 'b) | ||
|
||
(etd-group "Conversion functions" | ||
(etd-examples b-dec-to-hex | ||
(b-dec-to-hex 2) => "02" | ||
(b-dec-to-hex 16) => "10" | ||
(b-dec-to-hex 280) => "0118")) | ||
|
||
;; (etd-group "Bit manipulation" | ||
;; ) | ||
|
||
;; (etd-group "Byte parsing" | ||
;; ) | ||
|
||
|
||
;;; b-examples.el ends here |