cleaning up directory structure
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 31 Dec 2020 04:18:32 +0000 (22:18 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 31 Dec 2020 04:18:32 +0000 (22:18 -0600)
.github/workflows/onyx-build.yml
.gitignore
Makefile
bin/onyx [new file with mode: 0755]
bin/test [new file with mode: 0755]
docs/todo
onyx [deleted file]
runtests.sh [deleted file]

index 31f527b2d8f6326a9cbba29fd3141af75269acac..7d197358754ff8c4bb09a9e985bbccb8822eee64 100644 (file)
@@ -18,4 +18,4 @@ jobs:
     - name: make
       run: make
     - name: run tests
-      run: ./runtests.sh
+      run: ./bin/test
index 6dc7d768fbbf05ce4eef06ab2beaad36ceaeb6b3..6ce4354fa2eb71bfb26604f31744eefde75c9e7e 100644 (file)
@@ -1,8 +1,6 @@
 **/*.o
 *.o
 tags
-test.c
-test
 *.wasm
 *.html
 session.vim
index b923f94a98277beaa920c4ff3b87f2e70b34e721..59c1bd30fdbe14deb0aa59fc1a3ce20e8101cd84 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ endif
 
 INCLUDES=-I./include
 LIBS=
-TARGET=./onyx
+TARGET=./bin/onyx
 
 # These aren't working yet
 INSTALL_FOLDER=/usr/share/onyx
diff --git a/bin/onyx b/bin/onyx
new file mode 100755 (executable)
index 0000000..e220a54
Binary files /dev/null and b/bin/onyx differ
diff --git a/bin/test b/bin/test
new file mode 100755 (executable)
index 0000000..01d8dd6
--- /dev/null
+++ b/bin/test
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+failed=0
+for test_file in ./tests/*.onyx ; do
+    filename=$(basename -- "$test_file")
+    name="${filename%.*}"
+
+    echo "⏲ Checking $name.onyx"
+
+    if ! ./bin/onyx "$test_file" -o "./tests/$name.wasm" >/dev/null; then
+        echo "❌ Failed to compile $name.onyx."
+        failed=1
+        continue
+    fi
+    
+    if ! node onyxcmd.js "./tests/$name.wasm" > ./tmpoutput; then
+        echo "❌ Failed to run $name.onyx."
+        failed=1
+        continue
+    fi
+
+    if ! diff ./tmpoutput "./tests/$name" >/dev/null; then
+        echo "❌ Test output did not match."
+        diff ./tmpoutput "./tests/$name"
+        # failed=0
+        continue
+    fi
+
+    rm "./tests/$name.wasm"
+done
+rm ./tmpoutput
+
+([ $failed = 0 ] && echo "✔ All tests passed.") \
+                  || echo "❌ Some tests failed."
+
+exit $failed
+
index 3e90abe54865c8c1eaaaa416901ca5c13958ab98..9099a620d4c8697e2683a720265c118580888eb2 100644 (file)
--- a/docs/todo
+++ b/docs/todo
@@ -158,6 +158,7 @@ Usability:
     [ ] Make README on GitHub better, and actually describe what to do
     [ ] Make compiler work on Windows
     [ ] Make compiler work on MacOS
+    [ ] Make Onyx easier to use from JS
     [ ] Add examples for the following language features:
         - Slices
         - Dynamic Arrays
diff --git a/onyx b/onyx
deleted file mode 100755 (executable)
index e220a54..0000000
Binary files a/onyx and /dev/null differ
diff --git a/runtests.sh b/runtests.sh
deleted file mode 100755 (executable)
index 92ea4fa..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-failed=0
-for test_file in ./tests/*.onyx ; do
-       filename=$(basename -- "$test_file")
-       name="${filename%.*}"
-
-       echo "⏲ Checking $name.onyx"
-
-       if ! ./onyx "$test_file" -o "./tests/$name.wasm" >/dev/null; then
-               echo "❌ Failed to compile $name.onyx."
-               failed=1
-               continue
-       fi
-       
-       if ! node onyxcmd.js "./tests/$name.wasm" > ./tmpoutput; then
-               echo "❌ Failed to run $name.onyx."
-               failed=1
-               continue
-       fi
-
-       if ! diff ./tmpoutput "./tests/$name" >/dev/null; then
-               echo "❌ Test output did not match."
-               diff ./tmpoutput "./tests/$name"
-               # failed=0
-               continue
-       fi
-
-       rm "./tests/$name.wasm"
-done
-rm ./tmpoutput
-
-([ $failed = 0 ] && echo "✔ All tests passed.") \
-                                 || echo "❌ Some tests failed."
-
-exit $failed
\ No newline at end of file