Skip to content

Commit

Permalink
[WIP] Migrate tests to use buttercup
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Mar 17, 2020
1 parent 4e5bf7d commit 4e653f2
Show file tree
Hide file tree
Showing 10 changed files with 661 additions and 551 deletions.
35 changes: 35 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
codecov:
notify:
# will no delay sending notifications until all ci is finished
require_ci_to_pass: no

coverage:
precision: 2
round: down
range: "65...90"

status:
project:
default:
# the amount that coverage can drop while still posting a success
threshold: 1%
patch: no
changes: no

comment:
layout: diff
behavior: default
require_changes: false

ignore:
- ".git"
- "*.yml"
- "*.json"
- "*.md"
- "*.mk"
- "*.txt"

# ignore folders and all its contents
- ".cask/.*"
- ".github/.*"
- "test/.*"
1 change: 0 additions & 1 deletion .ert-runner

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,12 @@ jobs:
- name: After Success Reporting
if: success()
run: git log --format=fuller -5

- name: Upload Code Coverage Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
yml: ./.codecov.yml
name: codecov-umbrella
flags: unittests
fail_ci_if_error: false
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@

# Directories to ignore (do not add trailing '/'s, they skip symlinks).
/.cask

# Code coverage report.
coverage-final.json
3 changes: 2 additions & 1 deletion Cask
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

(development
(depends-on "dash")
(depends-on "ert-runner")
(depends-on "buttercup")
(depends-on "undercover")
(depends-on "el-mock")
(depends-on "noflet"))
46 changes: 7 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,63 +1,31 @@
## Sane defaults

SHELL := $(shell which bash)
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

EMACS ?= emacs
CASK ?= cask

EMACSFLAGS ?=
TESTFLAGS ?= --reporter ert+duration

VERSION = undefined

.DEFAULT_GOAL = build

## File lists

SRCS = esup-child.el esup.el
OBJS = $(SRCS:.el=.elc)

## Internal variables

EMACSBATCH = $(EMACS) -Q --batch -L . $(EMACSFLAGS)
RUNEMACS =

## Program availability

HAVE_CASK := $(shell sh -c "command -v $(CASK)")
ifndef HAVE_CASK
$(warning "$(CASK) is not available. Please run make help")
RUNEMACS = $(EMACSBATCH)
else
RUNEMACS = $(CASK) exec $(EMACSBATCH)
VERSION = $(shell $(CASK) version)
endif
include default.mk

%.elc: %.el
@$(RUNEMACS) --eval '(setq byte-compile-error-on-warn t)' -f batch-byte-compile $<
@printf "Compiling $<\n"
@$(RUNEMACS) --eval '(setq byte-compile-error-on-warn t)' \
-f batch-byte-compile $<

## Public targets

.PHONY: .title
.title:
$(info Esup $(VERSION))
@echo Esup $(VERSION)

.PHONY: init
init: Cask
@$(CASK) install

.PHONY: test
test:
@$(CASK) exec ert-runner $(TESTFLAGS)
@$(CASK) exec buttercup $(TESTFLAGS)

.PHONY: build
build: $(OBJS)

.PHONY: clean
clean:
$(info Remove all byte compiled Elisp files...)
@$(RM) -f $(OBJS)
@$(CASK) clean-elc

.PHONY: help
help: .title
Expand Down
26 changes: 26 additions & 0 deletions default.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Run “make build” by default
.DEFAULT_GOAL = build

EMACS ?= emacs
CASK ?= cask

EMACSFLAGS ?=
TESTFLAGS ?= -L .

EMACSBATCH = $(EMACS) -Q --batch -L . $(EMACSFLAGS)
RUNEMACS =

# Program availability
HAVE_CASK := $(shell sh -c "command -v $(CASK)")
ifndef HAVE_CASK
$(warning "$(CASK) is not available. Please run make help")
RUNEMACS = $(EMACSBATCH)
else
RUNEMACS = $(CASK) exec $(EMACSBATCH)
endif

VERSION="$(shell sed -nre '/^;; Version:/ { s/^;; Version:[ \t]+//; p }' esup.el)"

# File lists
SRCS = esup-child.el esup.el
OBJS = $(SRCS:.el=.elc)
Loading

0 comments on commit 4e653f2

Please sign in to comment.