Skip to content

Commit

Permalink
WIP test
Browse files Browse the repository at this point in the history
  • Loading branch information
metawilm committed Jun 13, 2024
1 parent 66eb75e commit 509a3de
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 15 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/github-workflow-tests.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(in-package :cl-user)

#+sbcl
(require :asdf)

(load "/tmp/ql-dir/quicklisp.lisp")
(quicklisp-quickstart:install)

(ql:quickload :closer-mop)
(ql:quickload :yacc)
(ql:quickload :cl-custom-hash-table)
(ql:quickload :cl-fad)

#-allegro
(ql:quickload :ptester)

(load "/home/runner/work/cl-python/cl-python/clpython.asd")

(ql:quickload :clpython)

(asdf:test-system :clpython)
75 changes: 75 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: build & test
on:
push:
branches:
- master
- dev
jobs:

install_ecl:
name: Download ECL
runs-on: ubuntu-latest
steps:
- run: |
cd /tmp
mkdir ecl-dir
cd ecl-dir
wget https://common-lisp.s3.eu-central-1.amazonaws.com/ecl-23.9.9.tgz
- name: Upload ECL artifact
uses: actions/upload-artifact@v4
with:
name: ecl-artifact
path: /tmp/ecl-dir/ecl-23.9.9.tgz

install_quicklisp:
name: Install QuickLisp
runs-on: ubuntu-latest
steps:
- run: |
cd /tmp
mkdir ql-dir
cd ql-dir
wget -q https://beta.quicklisp.org/quicklisp.lisp
chmod -R a+rwx /tmp/ql-dir
- name: Upload Quicklisp artifact
uses: actions/upload-artifact@v4
with:
name: ql-artifact
path: /tmp/ql-dir

run_test_suites:
name: Test on ${{ matrix.scenario }}
runs-on: ubuntu-latest
strategy:
matrix:
scenario: [ecl, sbcl]
needs: [install_quicklisp]
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: ql-artifact
path: /tmp/ql-dir

- if: matrix.scenario == 'ecl'
uses: actions/download-artifact@v4
with:
name: ecl-artifact
path: /tmp/ecl-dir/
- if: matrix.scenario == 'ecl'
run: |
cd /tmp/ecl-dir/
tar -xzf ecl-23.9.9.tgz
cd ecl-23.9.9
./configure
make -j 8
sudo make install
- if: matrix.scenario == 'ecl'
run: |
ecl --shell /home/runner/work/cl-python/cl-python/.github/workflows/github-workflow-tests.lisp
- if: matrix.scenario == 'sbcl'
run: |
sudo apt-get install sbcl
sbcl --script /home/runner/work/cl-python/cl-python/.github/workflows/github-workflow-tests.lisp
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ See the [build status](https://travis-ci.org/metawilm/cl-python) on Travis-CI, a

| Common Lisp Implementation | Build + Test Status | |
|:-:|:-:|:-:|
| [ABCL](https://common-lisp.net/project/armedbear/) 1.5.0 | [![Build Status](https://travis-build-job-badge.herokuapp.com/badge?user=metawilm&repo=cl-python&branch=master&envContains=abcl+CATCH&label=ABCL)](https://travis-ci.org/metawilm/cl-python) | Fails due to `ClassCastException: StandardObject cannot be cast to LispClass` |
| [Allegro CL](http://franz.com/products/allegrocl/) 10.1 | [![Build Status](https://travis-build-job-badge.herokuapp.com/badge?user=metawilm&repo=cl-python&branch=master&envContains=allegro+CATCH&label=Allegro+CL)](https://travis-ci.org/metawilm/cl-python) | |
| [Clozure CL](http://clozure.com/clozurecl.html) 1.11 | [![Build Status](https://travis-build-job-badge.herokuapp.com/badge?user=metawilm&repo=cl-python&branch=master&envContains=ccl&label=Clozure+CL)](https://travis-ci.org/metawilm/cl-python) | |
| [CLISP](http://clisp.sourceforge.net) 2.49 | [![Build Status](https://travis-build-job-badge.herokuapp.com/badge?user=metawilm&repo=cl-python&branch=master&envContains=clisp&label=CLISP)](https://travis-ci.org/metawilm/cl-python) | Fails due to stack overflow |
| [ABCL](https://common-lisp.net/project/armedbear/) | ? | |
| [Allegro CL](http://franz.com/products/allegrocl/) | ? | |
| [Clozure CL](http://clozure.com/clozurecl.html) | ? | |
| [CLISP 2.49.93](https://clisp.sourceforge.io) | ❌ | Dependency `cl-fad` → `bordeaux-threads` not supported |
| [CMUCL](http://www.cons.org/cmucl/) | ? | |
| [ECL](http://ecls.sourceforge.net/) 16.1.3 | [![Build Status](https://travis-build-job-badge.herokuapp.com/badge?user=metawilm&repo=cl-python&branch=master&envContains=ecl+CATCH&label=ECL)](https://travis-ci.org/metawilm/cl-python) | |
| [LispWorks](http://www.lispworks.com/) 6.1.1 || Manually verified |
| [SBCL](http://sbcl.sourceforge.net/) 1.5.4 | [![Build Status](https://travis-build-job-badge.herokuapp.com/badge?user=metawilm&repo=cl-python&branch=master&envContains=sbcl&label=SBCL)](https://travis-ci.org/metawilm/cl-python) [![Coverage Status](https://coveralls.io/repos/metawilm/cl-python/badge.svg?branch=master)](https://coveralls.io/r/metawilm/cl-python?branch=master) | |
| [ECL 23.9.9](https://ecl.common-lisp.dev) | ? | |
| [LispWorks](http://www.lispworks.com/) | ? | |
| [SBCL 2.1.11](https://www.sbcl.org) | ✅ | |
20 changes: 13 additions & 7 deletions clpython.asd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
(eval-when (:compile-toplevel)
(error "This ASDF file should be run interpreted."))

(eval-when (compile load eval)
(import '(asdf:defsystem asdf:load-op asdf:test-op))
(import '(uiop/package:find-symbol* uiop/package:symbol-call)))

;;; CL-Python is split into several ASDF systems, to make it possible to load
;;; specific components -- in particular, to load the compiler or parser without
Expand All @@ -31,7 +34,7 @@
(muffle-warning c))))))
(funcall thunk)))

(defsystem "clpython/basic"
(asdf:defsystem "clpython/basic"
:description "CLPython package and utils"
:depends-on ("closer-mop")
:serial t
Expand All @@ -53,7 +56,7 @@
(when (asdf:find-system "yacc" nil)
(pushnew :have-cl-yacc *features*))

(defsystem "clpython/parser"
(asdf:defsystem "clpython/parser"
:description "Python parser, code walker, and pretty printer"
:depends-on ("clpython/basic"
"closer-mop"
Expand All @@ -68,7 +71,7 @@
(:file "walk" )
(:file "pprint" )))))

(defsystem "clpython/compiler"
(asdf:defsystem "clpython/compiler"
:description "Python compiler"
:depends-on ("clpython/basic" "clpython/parser" "clpython/runtime" "closer-mop")
:serial t
Expand All @@ -81,7 +84,7 @@
(:file "generator" )
(:file "optimize" )))))

(defsystem "clpython/runtime"
(asdf:defsystem "clpython/runtime"
:description "Python runtime environment"
:depends-on ("clpython/basic" "closer-mop" #+(or abcl clisp ecl) "cl-custom-hash-table" "cl-fad")
:components ((:module "runtime"
Expand All @@ -96,7 +99,7 @@
(:file "run" )
(:file "import" )))))

(defsystem "clpython/lib"
(asdf:defsystem "clpython/lib"
:description "Python module library"
:depends-on ("clpython/basic" "clpython/runtime" "clpython/compiler" #| TODO: remove compiler dep |#)
:components ((:module "lib"
Expand Down Expand Up @@ -141,7 +144,7 @@
(:file "time" :depends-on ("lsetup"))
(:file "_weakref" :depends-on ("lsetup"))))))

(defsystem "clpython/contrib"
(asdf:defsystem "clpython/contrib"
:description "CLPython contributions and experiments"
:depends-on ("clpython/basic" "clpython/runtime" "clpython/compiler")
:components ((:module "contrib"
Expand Down Expand Up @@ -193,4 +196,7 @@
(:file "mod-string-test")
(:file "mod-math-test")
(:file "mod-operator-test"))))
:perform (test-op (o c) (symbol-call :clpython.test :run-tests)))
:perform (test-op (o c)
(if (symbol-call :clpython.test :run-tests)
(format t "clpython/test test-op: No test failures.~%")
(error "clpython/test test-op: Some test failures."))))
2 changes: 1 addition & 1 deletion test/tsetup.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@ seems to give implementations some freedom here. (In practice: Allegro=NIL, LisW
unexpected-failures *test-unexpected-failures*))

(let ((vals (list final-result successes errors unexpected-failures)))
(format t "~%Return values of RUN-TESTS: ~A" vals)
(format t "~%Return values of RUN-TESTS: ~A~%" vals)
(values-list vals))))

0 comments on commit 509a3de

Please sign in to comment.