Skip to content

Commit

Permalink
Corrected C# script comments and add typescript test.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Aug 17, 2020
1 parent 8b797e5 commit 61a0d62
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 18 deletions.
24 changes: 24 additions & 0 deletions tests/scripts/fib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* MetaCall Distributable by Parra Studios
* Distributable infrastructure for MetaCall.
*
* Copyright (C) 2016 - 2020 Vicente Eduardo Ferrer Garcia <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

export function fibonacci(num: number): number {
return (num <= 1) ? 1 : fibonacci(num - 1) + fibonacci(num - 2);
}
36 changes: 18 additions & 18 deletions tests/scripts/say.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#
# MetaCall Distributable by Parra Studios
# Distributable infrastructure for MetaCall.
#
# Copyright (C) 2016 - 2020 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
/**
* MetaCall Distributable by Parra Studios
* Distributable infrastructure for MetaCall.
*
* Copyright (C) 2016 - 2020 Vicente Eduardo Ferrer Garcia <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using System;

Expand Down
58 changes: 58 additions & 0 deletions tests/typescript/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#
# MetaCall Distributable by Parra Studios
# Distributable infrastructure for MetaCall.
#
# Copyright (C) 2016 - 2020 Vicente Eduardo Ferrer Garcia <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

FROM busybox:1.31.1 AS node_test

# Image descriptor
LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \
copyright.address="[email protected]" \
maintainer.name="Vicente Eduardo Ferrer Garcia" \
maintainer.address="[email protected]" \
vendor="MetaCall Inc." \
version="0.1"

COPY out/tarball.tar.gz /

RUN cd / \
&& tar -xzf tarball.tar.gz \
&& rm tarball.tar.gz

COPY tests/scripts/ /scripts/

COPY tests/node/test.js /scripts/

ARG CACHE_INVALIDATE

RUN echo "Running tests ${CACHE_INVALIDATE}" \
&& export PATH="/gnu/bin:${PATH}" \
&& npm install metacall

RUN export LOADER_SCRIPT_PATH="/scripts/" \
&& export METACALL_PATH="/gnu/store/`ls /gnu/store/ | grep metacall | head -n 1`" \
&& export LOADER_LIBRARY_PATH="${METACALL_PATH}/lib" \
&& export SERIAL_LIBRARY_PATH="${METACALL_PATH}/lib" \
&& export DETOUR_LIBRARY_PATH="${METACALL_PATH}/lib" \
&& export PORT_LIBRARY_PATH="${METACALL_PATH}/lib" \
&& export CONFIGURATIONS_PATH="${METACALL_PATH}/configurations/global.json" \
&& export NODE_ENV=debug \
&& printf 'load ts fib.ts\ncall fibonacci(10)\nexit' | ${METACALL_PATH}/metacallcli \
| grep \
-e '89'

ENTRYPOINT ["sh", "-c"]

0 comments on commit 61a0d62

Please sign in to comment.