assert: version 1.0.0
This commit is contained in:
parent
ef3d49653d
commit
940def0092
39
Makefile
39
Makefile
|
|
@ -1,54 +1,53 @@
|
|||
.POSIX:
|
||||
SCHEME=chibi
|
||||
LIBRARY=tap
|
||||
LIBRARY_FILE=retropikzel/${LIBRARY}.sld
|
||||
MAINTAINER=Retropikzel
|
||||
TESTFILE=retropikzel/${LIBRARY}/test.scm
|
||||
DOCKER_TAG=latest
|
||||
|
||||
library_file=retropikzel/${LIBRARY}.sld
|
||||
testfile=retropikzel/${LIBRARY}/test.scm
|
||||
splitclean=awk -F ':' '{print($$2)}' | tr -d ' '
|
||||
VERSION=$$(grep "VERSION:" ${LIBRARY_FILE} | ${splitclean})
|
||||
LICENSE=$$(grep "SPDX-License-Identifier:" ${LIBRARY_FILE} | awk -F ":" "{print(\$$2)}" | tr -d ' ')
|
||||
DESCRIPTION=$$(grep "DESCRIPTION:" ${LIBRARY_FILE} | awk -F ':' '{print($$2)}' | tr -d ' ')
|
||||
ADDITIONAL_LIBRARIES=$$(grep "ADD_LIBRARIES:" ${LIBRARY_FILE} | awk -F ':' '{print($$2)}' | tr -d ' ' || echo "")
|
||||
version=$$(grep "Version:" ${library_file} | ${splitclean})
|
||||
license=$$(grep "SPDX-License-Identifier:" ${library_file} | awk -F ":" "{print(\$$2)}" | tr -d ' ')
|
||||
description=$$(grep "Description:" ${library_file} | awk -F ':' '{print($$2)}' | tr -d ' ')
|
||||
additional_libraries=$$(grep "Additional Libraries:" ${library_file} | awk -F ':' '{print($$2)}' || echo "")
|
||||
|
||||
PKG=retropikzel-${LIBRARY}-${VERSION}.tgz
|
||||
pkg=retropikzel-${LIBRARY}-${version}.tgz
|
||||
|
||||
debug:
|
||||
echo "${LICENSE}"
|
||||
echo "${license}"
|
||||
|
||||
all: package
|
||||
|
||||
package:
|
||||
snow-chibi package \
|
||||
--always-yes \
|
||||
--version="${VERSION}" \
|
||||
--version="${version}" \
|
||||
--authors=Retropikzel \
|
||||
--maintainers=Retropikzel \
|
||||
--license="${LICENSE}" \
|
||||
--license="${license}" \
|
||||
--doc-from-scribble=1 \
|
||||
--test=${TESTFILE} \
|
||||
--description="${DESCRIPTION}" \
|
||||
${LIBRARY_FILE} ${ADDITIONAL_LIBRARIES}
|
||||
--test=${testfile} \
|
||||
--description="${description}" \
|
||||
${library_file} ${additional_libraries}
|
||||
|
||||
git-index:
|
||||
snow-chibi git-index ${PKG}
|
||||
snow-chibi git-index ${pkg}
|
||||
|
||||
install:
|
||||
snow-chibi install --impls=${SCHEME} --always-yes --verbose?=1 --skip-tests?=1 ${PKG}
|
||||
snow-chibi install --impls=${SCHEME} --always-yes --verbose?=1 --skip-tests?=1 ${pkg}
|
||||
|
||||
test: package
|
||||
snow-chibi --impls=${SCHEME} test-package ${PKG}
|
||||
snow-chibi --impls=${SCHEME} test-package ${pkg}
|
||||
|
||||
test-compile-r7rs:
|
||||
COMPILE_R7RS=${SCHEME} compile-r7rs -o test-program ${TESTFILE}
|
||||
COMPILE_R7RS=${SCHEME} compile-r7rs -o test-program ${testfile}
|
||||
./test-program
|
||||
|
||||
test-docker:
|
||||
DOCKER_TAG=${DOCKER_TAG} \
|
||||
SNOW_PACKAGES="retropikzel.tap ${PKG}" \
|
||||
SNOW_PACKAGES="retropikzel.tap ${pkg}" \
|
||||
COMPILE_R7RS=${SCHEME} \
|
||||
test-r7rs -o test-program ${TESTFILE}
|
||||
test-r7rs -o test-program ${testfile}
|
||||
|
||||
retropikzel/wasm/plus.wat: retropikzel/wasm/plus.c
|
||||
emcc -o retropikzel/wasm/plus.js retropikzel/wasm/plus.c
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
;; SPDX-License-Identifier: LGPL
|
||||
;; VERSION: 0.1.0
|
||||
;; DESCRIPTION: Assert
|
||||
;; ADDITIONAL_LIBRARIES: retropikzel/assert/pass.sld
|
||||
;; SPDX-License-Identifier: AGPL-3.0
|
||||
;; Version: 1.0.0
|
||||
;; Description: Assert
|
||||
;; Additional Libraries: retropikzel/assert/warning.sld retropikzel/assert/ignore.sld
|
||||
|
||||
(define-library
|
||||
(retropikzel assert)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
(define-syntax assert
|
||||
(syntax-rules ()
|
||||
((_ check val err-msg)
|
||||
(cond-expand (else)))))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
(define-library
|
||||
(retropikzel assert ignore)
|
||||
(import (scheme base))
|
||||
(export assert)
|
||||
(include "ignore.scm"))
|
||||
|
|
@ -1 +0,0 @@
|
|||
(define-syntax assert (syntax-rules () ((_ check val err-msg) #t)))
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
;; SPDX-License-Identifier: LGPL
|
||||
;; VERSION: 0.1.0
|
||||
;; DESCRIPTION: Assert passtrough
|
||||
|
||||
(define-library
|
||||
(retropikzel assert pass)
|
||||
(import (scheme base))
|
||||
(export assert)
|
||||
(include "pass.scm"))
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
(define-syntax assert
|
||||
(syntax-rules ()
|
||||
((_ check val err-msg)
|
||||
(unless (check val)
|
||||
(display "WARNING: " (current-error-port))
|
||||
(display err-msg (current-error-port))
|
||||
(display ", val: " (current-error-port))
|
||||
(write val (current-error-port))
|
||||
(newline (current-error-port))))))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
(define-library
|
||||
(retropikzel assert warning)
|
||||
(import (scheme base))
|
||||
(export assert)
|
||||
(include "warning.scm"))
|
||||
Loading…
Reference in New Issue