-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from libriscv/testing
Testing framework
- Loading branch information
Showing
19 changed files
with
123 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
build/ | ||
.build/ | ||
.godot/ | ||
.mingw/ | ||
.vscode/ | ||
program/test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../ext/Gut/addons/gut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/gonzo/github/godot-riscv/.build/libgodot-riscv.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/gonzo/github/godot-riscv/.build/libgodot-riscv.so |
1 change: 1 addition & 0 deletions
1
tests/extensions/bin/libgodot_riscv.web.template_debug.wasm32.wasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/gonzo/github/godot-riscv/bin/addons/godot_sandbox/bin/libgodot_riscv.web.template_debug.wasm32.wasm |
1 change: 1 addition & 0 deletions
1
tests/extensions/bin/libgodot_riscv.web.template_release.wasm32.wasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/gonzo/github/godot-riscv/bin/addons/godot_sandbox/bin/libgodot_riscv.web.template_release.wasm32.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[configuration] | ||
|
||
entry_symbol = "riscv_library_init" | ||
compatibility_minimum = "4.1" | ||
|
||
[icons] | ||
|
||
|
||
[libraries] | ||
|
||
macos.debug = "bin/libgodot-riscv.macos.debug.framework" | ||
macos.release = "bin/libgodot-riscv.macos.release.framework" | ||
windows.debug.x86_64 = "bin/libgodot-riscv.windows.debug.x86_64.dll" | ||
windows.release.x86_64 = "bin/libgodot-riscv.windows.release.x86_64.dll" | ||
linux.debug.x86_64 = "bin/libgodot-riscv.linux.debug.x86_64.so" | ||
linux.release.x86_64 = "bin/libgodot-riscv.linux.release.x86_64.so" | ||
web.debug.wasm32 = "bin/libgodot_riscv.web.template_debug.wasm32.wasm" | ||
web.release.wasm32 = "bin/libgodot_riscv.web.template_release.wasm32.wasm" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://6xqmeymr5t3" | ||
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://icon.svg" | ||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 | ||
svg/scale=1.0 | ||
editor/scale_with_editor_scale=false | ||
editor/convert_colors_with_editor_theme=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; Engine configuration file. | ||
; It's best edited using the editor UI and not directly, | ||
; since the parameters that go here are not all obvious. | ||
; | ||
; Format: | ||
; [section] ; section goes between [] | ||
; param=value ; assign values to parameters | ||
|
||
config_version=5 | ||
|
||
[application] | ||
|
||
config/name="tests" | ||
config/features=PackedStringArray("4.3", "Forward Plus") | ||
config/icon="res://icon.svg" | ||
|
||
[editor_plugins] | ||
|
||
enabled=PackedStringArray("res://addons/gut/plugin.cfg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "api.hpp" | ||
|
||
extern "C" Variant public_function() { | ||
return "Hello from the other side"; | ||
} | ||
|
||
extern "C" Variant test_dictionary(Variant dict) { | ||
return Dictionary(dict)["1"]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
extends GutTest | ||
|
||
func test_instantiation(): | ||
# Create a new sandbox | ||
var s = Sandbox.new() | ||
# Set the test program | ||
s.set_program(Sandbox_TestsTests) | ||
|
||
# Verify that a basic function that returns a String works | ||
assert_eq(s.vmcall("public_function"), "Hello from the other side") | ||
|
||
# Verify that the sandbox can receive a Dictionary and return an element | ||
var d : Dictionary | ||
d["1"] = Dictionary() | ||
d["1"]["2"] = "3" | ||
|
||
assert_eq(s.vmcall("test_dictionary", d), d["1"]) |