Skip to content

Commit

Permalink
Merge pull request #7 from 40ants/add-a-test
Browse files Browse the repository at this point in the history
Added one test and a few exports.
  • Loading branch information
svetlyak40wt committed Feb 19, 2021
2 parents 8cc7116 + fabaf21 commit 3517968
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 28 deletions.
49 changes: 34 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
tests:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.can-fail || false }}
# continue-on-error: ${{ matrix.can-fail || false }}

strategy:
fail-fast: false
Expand All @@ -52,24 +52,36 @@ jobs:
- allegro
- clisp
- cmucl
include:
exclude:
# Seems allegro is does not support 64bit OSX.
# Unable to install it using Roswell:
# alisp is not executable. Missing 32bit glibc?
- lisp: allegro
os: macos-latest
can-fail: true
- os: macos-latest
lisp: allegro
# CLISP on OSX is built without support for threads,
# but Rove depends on bordeaux-threads and it fails to load
# https://github.com/roswell/roswell/issues/461
- os: macos-latest
lisp: clisp
quicklisp-dist: ultralisp
# CMUCL is 32bit and cant' work on 64bit OSX:
# .roswell/impls/x86-64/darwin/cmu-bin/21d/bin/lisp is not executable. Missing 32bit glibc?
- os: macos-latest
lisp: cmucl
# CLisp on Ubuntu can't be installed because of the error:
# #<FOREIGN-VARIABLE "rl_readline_state" #x00007FA93E698850> does not have
# the required size or alignment
- lisp: clisp
os: ubuntu-latest
can-fail: true
# CMUCL is 32bit and cant' work on 64bit OSX:
# .roswell/impls/x86-64/darwin/cmu-bin/21d/bin/lisp is not executable. Missing 32bit glibc?
- lisp: cmucl
os: macos-latest
can-fail: true
- os: ubuntu-latest
lisp: clisp
# Disabled because Rove does not work on this configuration:
# https://github.com/fukamachi/rove/issues/47
- os: ubuntu-latest
lisp: allegro
# CMUCL on ubuntu is built without threading support
# but Rove depends on bordeaux-threads and it fails to load
# https://github.com/roswell/roswell/issues/461
- os: ubuntu-latest
lisp: cmucl

env:
LISP: ${{ matrix.lisp }}
Expand All @@ -87,11 +99,18 @@ jobs:
{% endifequal %}
github mgl-pax svetlyak40wt/mgl-pax :branch mgl-pax-minimal
- name: Check Roswell setup
run: ros config

- uses: 40ants/run-tests@v2
with:
asdf-system: cl-info
coveralls-token: ${{ secrets.github_token }}
coveralls-token: |
${{ matrix.lisp == 'sbcl-bin' &&
matrix.os == 'ubuntu-latest' &&
matrix.quicklisp-dist == 'ultralisp' &&
secrets.github_token }}
# This is additional step to check
# a command line script
Expand Down
6 changes: 3 additions & 3 deletions cl-info-test.asd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(defsystem cl-info-test
:author ""
:license ""
:author "Alexander Artemenko"
:license "BSD"
:class :package-inferred-system
:pathname "t"
:depends-on ("hamcrest"
Expand All @@ -9,4 +9,4 @@

:perform (test-op (op c)
(unless (symbol-call :rove :run c)
(error "Tests failed"))))
(error "Tests failed"))))
4 changes: 4 additions & 0 deletions qlfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
dist ultralisp http://dist.ultralisp.org

# Unless this pull will be merged:
# https://github.com/sionescu/bordeaux-threads/pull/86
github bordeaux-threads svetlyak40wt/bordeaux-threads :branch fix-apiv2-for-no-threads

# Unless this patch is not merged:
github mgl-pax svetlyak40wt/mgl-pax :branch mgl-pax-minimal
6 changes: 5 additions & 1 deletion qlfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
("ultralisp" .
(:class qlot/source/dist:source-dist
:initargs (:distribution "http://dist.ultralisp.org" :%version :latest)
:version "20210207102000"))
:version "20210219143000"))
("bordeaux-threads" .
(:class qlot/source/github:source-github
:initargs (:repos "svetlyak40wt/bordeaux-threads" :ref nil :branch "fix-apiv2-for-no-threads" :tag nil)
:version "github-c5ed58df63356d7e2892b54cbd9dd7da"))
("mgl-pax" .
(:class qlot/source/github:source-github
:initargs (:repos "svetlyak40wt/mgl-pax" :ref nil :branch "mgl-pax-minimal" :tag nil)
Expand Down
13 changes: 11 additions & 2 deletions src/core.lisp
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
(defpackage #:cl-info
(uiop:define-package #:cl-info
(:nicknames #:cl-info/core)
(:use #:cl)
(:import-from #:mgl-pax-minimal
#:defsection
#:reader)
(:export #:cl-info
#:get-cl-info
#:get-system-info))
#:get-system-info
#:get-software-version
#:get-software-type
#:get-lisp-version
#:get-lisp-type
#:get-asdf-version
#:get-version
#:get-name
#:absent-p
#:get-path))
(in-package cl-info/core)


Expand Down
21 changes: 14 additions & 7 deletions t/core.lisp
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
(defpackage #:cl-info-test/core
(uiop:define-package #:cl-info-test/core
(:use #:cl)
(:import-from #:cl-info)
(:import-from #:hamcrest/rove
#:contains
#:assert-that)
(:import-from #:rove
#:testing
#:ok
#:deftest))
(in-package cl-info-test/core)


(defun foo (a b)
(list a b))
(deftest test-system-info
(testing "Checking if we can get system info and it will have the version from ASDF"
(let ((info (cl-info:get-system-info :cl-info))
(system (asdf:find-system :cl-info)))
(ok (not (null info)))
(ok (equal (cl-info:get-version info)
(asdf:component-version system))))))


(deftest test-some-staff
(testing "Replace this test with real staff."
(assert-that (foo 1 2)
(contains 1 2))))
(deftest test-absent-system-info
(testing "Checking if we can get system info and it will have the version from ASDF"
(let ((info (cl-info:get-system-info :unknown-system)))
(ok (not (null info)))
(ok (cl-info:absent-p info)))))

0 comments on commit 3517968

Please sign in to comment.