<h3>Contribution description</h3>
<p>A joke can go wrong when people don't understand it, and it can <em>wronger</em> if they take it seriously...</p>
<p>This commit is based on <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="427591174" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11319" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11319/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11319">#11319</a> and adds support for the "shell" statement. In BASIC, this is supposed to call a system command.</p>
<p>I used "system()" to implement it.</p>
<h3>Testing procedure</h3>
<p>Run the test. Test case no.3 takes ages in a board (I tested samr21) so you can use the following patch to disable it (place it under <code>pkg/ubasic/patches</code>).<br>
<code>0006-remove-me-relax-test-2.patch</code></p>
<div class="highlight highlight-source-diff"><pre>From 83837232900bbdd2e8827046a428ecdb0655eb3c Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Fri, 5 Apr 2019 16:29:48 +0200
Subject: [PATCH 6/6] remove me - relax test 2

<span class="pl-ms">---</span>
 tests.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

<span class="pl-c1">diff --git a/tests.c b/tests.c</span>
index b4ac79a..7c0575a 100644
<span class="pl-md">--- a/tests.c</span>
<span class="pl-mi1">+++ b/tests.c</span>
<span class="pl-mdr">@@ -48,8 +48,8 @@</span> static const char program_goto[] =
 70 end\n";
 
 static const char program_loop[] =
<span class="pl-md"><span class="pl-md">-</span>"10 for i = 0 to 126\n\</span>
<span class="pl-md"><span class="pl-md">-</span>20 for j = 0 to 126\n\</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>"10 for i = 0 to 1\n\</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>20 for j = 0 to 1\n\</span>
 30 for k = 0 to 10\n\
 40 let a = i * j * k\n\
 rem 45 print a, i, j, k\n\
<span class="pl-mdr">@@ -128,7 +128,7 @@</span> main(void)
   assert(ubasic_get_variable(2) == 108);
 
   run(program_loop);
<span class="pl-md"><span class="pl-md">-</span>  assert(ubasic_get_variable(0) == (VARIABLE_TYPE)(126 * 126 * 10));</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>   /* assert(ubasic_get_variable(0) == (VARIABLE_TYPE)(126 * 126 * 10)); */</span>
 
   run(program_shell);
 
<span class="pl-md"><span class="pl-md">-</span>- </span>
2.21.0</pre></div>
<h3>Side notes.</h3>
<p>The modifications to ubasic were unexpectedly easy. I spent most of the time figuring out how to get system() running in RIOT. One of the biggest issues I had was that at some point I added a main.c to the test application and afterwards remove it, bit the main.o was still there messing up the symbols!!!</p>
<h3>Issues/PRs references</h3>
<p>Depends (and extends) <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="427591174" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11319" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11319/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11319">#11319</a> .</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/RIOT-OS/RIOT/pull/11349'>https://github.com/RIOT-OS/RIOT/pull/11349</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>pkg: Initial introduction of ubasic package</li>
  <li>tests: provide tests for ubasic package</li>
  <li>fixup! tests: provide tests for ubasic package</li>
  <li>fixup! tests: provide tests for ubasic package</li>
  <li>fixup! fixup! tests: provide tests for ubasic package</li>
  <li>fixup! fixup! fixup! tests: provide tests for ubasic package</li>
  <li>fixup! tests: provide tests for ubasic package</li>
  <li>fixup! pkg: Initial introduction of ubasic package</li>
  <li>fixup! tests: provide tests for ubasic package</li>
  <li>fixup! fixup! pkg: Initial introduction of ubasic package</li>
  <li>fixup! fixup! tests: provide tests for ubasic package</li>
  <li>sys/shell: Add echo to the default system commands.</li>
  <li>sys/shell: Make the shell provide the system() function.</li>
  <li>pkg/ubasic: add support for the "shell" BASIC statement.</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-0">pkg/ubasic/Makefile</a>
    (21)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-1">pkg/ubasic/Makefile.include</a>
    (1)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-2">pkg/ubasic/doc.txt</a>
    (6)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-3">pkg/ubasic/patches/0001-Remove-ubasic_init_peek_poke.patch</a>
    (67)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-4">pkg/ubasic/patches/0002-Allow-setting-debug-option-from-shell.patch</a>
    (39)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-5">pkg/ubasic/patches/0003-Add-program-to-execute-script-from-file.patch</a>
    (123)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-6">pkg/ubasic/patches/0004-Do-not-call-exit-on-error.patch</a>
    (118)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-7">pkg/ubasic/patches/0005-Add-shell-command.patch</a>
    (126)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-8">pkg/ubasic/ubasic.mk</a>
    (6)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-9">pkg/ubasic/ubasic_tests.mk</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-10">sys/shell/commands/sc_sys.c</a>
    (16)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-11">sys/shell/commands/shell_commands.c</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-12">sys/shell/shell.c</a>
    (14)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-13">tests/pkg_ubasic/Makefile</a>
    (12)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11349/files#diff-14">tests/pkg_ubasic/tests/01-run.py</a>
    (19)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11349.patch'>https://github.com/RIOT-OS/RIOT/pull/11349.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11349.diff'>https://github.com/RIOT-OS/RIOT/pull/11349.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11349">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AEn7YHDoYcdnJyIOZslFKnFWYRei58qYks5vd3dIgaJpZM4cfRxX">mute the thread</a>.<img src="https://github.com/notifications/beacon/AEn7YBblEsvt0b6oSiaSEoay17duMLhzks5vd3dIgaJpZM4cfRxX.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/RIOT-OS/RIOT","title":"RIOT-OS/RIOT","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/RIOT-OS/RIOT"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"pkg/ubasic: add support for BASIC's \"shell\"  statement.  (#11349)"}],"action":{"name":"View Pull Request","url":"https://github.com/RIOT-OS/RIOT/pull/11349"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11349",
"url": "https://github.com/RIOT-OS/RIOT/pull/11349",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>