Commit 17bf4145 authored by Daniel Kochmański's avatar Daniel Kochmański

packaging: add ASD and some basic test suite

parent bc328488
;;; Ensure the package
(defpackage #:metering/test
(:use #:cl #:5am #:mon))
(in-package #:metering/test)
;;; Ensure the suite
(def-suite :metering-suite
:description "The example test suite.")
(in-suite :metering-suite)
;;; Define a few functions to monitor functions
(defun test-fun-1 ()
(dotimes (v 100) (cons 'b 'c)))
(defun test-fun-2 (x)
(if (> x 3)
(test-fun-2 (1+ x))))
;;; Define some tests
(test dumb-test
"Test if the testing works"
(is (= 1 1)))
(test monitor-null
"Check if adding non-existant function doesn't change the list of
monitored functions"
(is (equal (monitor nil)
(monitor xyz))))
(test with-monitoring
"Monitor two functions"
(finishes (with-monitoring (test-fun-1 test-fun-2) ()
(test-fun-2 1))))
;;;; metering.asd
(asdf:defsystem #:metering
:name "Metering"
:version "3.0"
:description "Portable Code Profiling Tool"
:author "Mark Kantrowitz <>"
:maintainer "Daniel Kochmański <>"
:license "Public Domain"
:homepage ""
:serial t
:depends-on ()
:components (( "metering"))
:in-order-to ((asdf:test-op
(asdf:test-op #:metering/test))))
(asdf:defsystem #:metering/test
:depends-on (#:metering #:fiveam)
:components ((:file "metering-test"))
:perform (asdf:test-op (o s)
(funcall (intern (string '#:run!) :metering/test)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment