assert: version 1.0.0
This commit is contained in:
parent
ef3d49653d
commit
940def0092
39
Makefile
39
Makefile
|
|
@ -1,54 +1,53 @@
|
||||||
.POSIX:
|
.POSIX:
|
||||||
SCHEME=chibi
|
SCHEME=chibi
|
||||||
LIBRARY=tap
|
LIBRARY=tap
|
||||||
LIBRARY_FILE=retropikzel/${LIBRARY}.sld
|
|
||||||
MAINTAINER=Retropikzel
|
|
||||||
TESTFILE=retropikzel/${LIBRARY}/test.scm
|
|
||||||
DOCKER_TAG=latest
|
DOCKER_TAG=latest
|
||||||
|
|
||||||
|
library_file=retropikzel/${LIBRARY}.sld
|
||||||
|
testfile=retropikzel/${LIBRARY}/test.scm
|
||||||
splitclean=awk -F ':' '{print($$2)}' | tr -d ' '
|
splitclean=awk -F ':' '{print($$2)}' | tr -d ' '
|
||||||
VERSION=$$(grep "VERSION:" ${LIBRARY_FILE} | ${splitclean})
|
version=$$(grep "Version:" ${library_file} | ${splitclean})
|
||||||
LICENSE=$$(grep "SPDX-License-Identifier:" ${LIBRARY_FILE} | awk -F ":" "{print(\$$2)}" | tr -d ' ')
|
license=$$(grep "SPDX-License-Identifier:" ${library_file} | awk -F ":" "{print(\$$2)}" | tr -d ' ')
|
||||||
DESCRIPTION=$$(grep "DESCRIPTION:" ${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 "")
|
additional_libraries=$$(grep "Additional Libraries:" ${library_file} | awk -F ':' '{print($$2)}' || echo "")
|
||||||
|
|
||||||
PKG=retropikzel-${LIBRARY}-${VERSION}.tgz
|
pkg=retropikzel-${LIBRARY}-${version}.tgz
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
echo "${LICENSE}"
|
echo "${license}"
|
||||||
|
|
||||||
all: package
|
all: package
|
||||||
|
|
||||||
package:
|
package:
|
||||||
snow-chibi package \
|
snow-chibi package \
|
||||||
--always-yes \
|
--always-yes \
|
||||||
--version="${VERSION}" \
|
--version="${version}" \
|
||||||
--authors=Retropikzel \
|
--authors=Retropikzel \
|
||||||
--maintainers=Retropikzel \
|
--maintainers=Retropikzel \
|
||||||
--license="${LICENSE}" \
|
--license="${license}" \
|
||||||
--doc-from-scribble=1 \
|
--doc-from-scribble=1 \
|
||||||
--test=${TESTFILE} \
|
--test=${testfile} \
|
||||||
--description="${DESCRIPTION}" \
|
--description="${description}" \
|
||||||
${LIBRARY_FILE} ${ADDITIONAL_LIBRARIES}
|
${library_file} ${additional_libraries}
|
||||||
|
|
||||||
git-index:
|
git-index:
|
||||||
snow-chibi git-index ${PKG}
|
snow-chibi git-index ${pkg}
|
||||||
|
|
||||||
install:
|
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
|
test: package
|
||||||
snow-chibi --impls=${SCHEME} test-package ${PKG}
|
snow-chibi --impls=${SCHEME} test-package ${pkg}
|
||||||
|
|
||||||
test-compile-r7rs:
|
test-compile-r7rs:
|
||||||
COMPILE_R7RS=${SCHEME} compile-r7rs -o test-program ${TESTFILE}
|
COMPILE_R7RS=${SCHEME} compile-r7rs -o test-program ${testfile}
|
||||||
./test-program
|
./test-program
|
||||||
|
|
||||||
test-docker:
|
test-docker:
|
||||||
DOCKER_TAG=${DOCKER_TAG} \
|
DOCKER_TAG=${DOCKER_TAG} \
|
||||||
SNOW_PACKAGES="retropikzel.tap ${PKG}" \
|
SNOW_PACKAGES="retropikzel.tap ${pkg}" \
|
||||||
COMPILE_R7RS=${SCHEME} \
|
COMPILE_R7RS=${SCHEME} \
|
||||||
test-r7rs -o test-program ${TESTFILE}
|
test-r7rs -o test-program ${testfile}
|
||||||
|
|
||||||
retropikzel/wasm/plus.wat: retropikzel/wasm/plus.c
|
retropikzel/wasm/plus.wat: retropikzel/wasm/plus.c
|
||||||
emcc -o retropikzel/wasm/plus.js retropikzel/wasm/plus.c
|
emcc -o retropikzel/wasm/plus.js retropikzel/wasm/plus.c
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
;; SPDX-License-Identifier: LGPL
|
;; SPDX-License-Identifier: AGPL-3.0
|
||||||
;; VERSION: 0.1.0
|
;; Version: 1.0.0
|
||||||
;; DESCRIPTION: Assert
|
;; Description: Assert
|
||||||
;; ADDITIONAL_LIBRARIES: retropikzel/assert/pass.sld
|
;; Additional Libraries: retropikzel/assert/warning.sld retropikzel/assert/ignore.sld
|
||||||
|
|
||||||
(define-library
|
(define-library
|
||||||
(retropikzel assert)
|
(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