-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
18 changed files
with
3,126 additions
and
471 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
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,22 @@ | ||
name: test JSFX | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ilammy/setup-nasm@v1 | ||
- uses: actions/checkout@v4 | ||
name: Check out repository code | ||
with: | ||
# Fetches all submodules recursively | ||
submodules: 'recursive' | ||
|
||
- name: Compile EEL2 with NO_GFX | ||
run: | | ||
./compile_wdl.sh | ||
- name: Run Tests | ||
run: | | ||
./test_eel.sh |
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 |
---|---|---|
|
@@ -360,3 +360,6 @@ MigrationBackup/ | |
|
||
# Fody - auto-generated XML schema | ||
FodyWeavers.xsd | ||
|
||
*.test.eel2 | ||
*.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "WDL"] | ||
path = WDL | ||
url = https://github.com/justinfrankel/WDL.git | ||
ignore = all |
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,2 @@ | ||
# welcome to experiments | ||
this is where I'm keeping some alternate versions of the plugin. |
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,5 @@ | ||
if [ ! -z "$PREFIX" ] && [ "$PREFIX" = "/data/data/com.termux/files/usr" ]; then | ||
# quick hack to enable testing in termux | ||
export CPPFLAGS='-Dpthread_mutexattr_setprotocol(a,b)={} -Wno-unused-but-set-variable' | ||
fi | ||
make -C WDL/WDL/eel2 NO_GFX=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,16 @@ | ||
function process_eel_script { | ||
local input_script="$1" | ||
local output_script="$2" | ||
local replace_str="$3" # New argument for the replacement | ||
|
||
# Process the second script and append its contents to the output script | ||
sed -r -e "s/\/\/IF${replace_str}|\/\*IF${replace_str}\{|\}IF${replace_str}\*\///" \ | ||
"$input_script" > "$output_script" | ||
} | ||
|
||
process_eel_script vocalrediso.jsfx-template vocalrediso.test TEST | ||
process_eel_script vocalrediso.jsfx-template vocalrediso.eel EEL | ||
process_eel_script vocalrediso.jsfx-template vocalrediso.jsfx JSFX | ||
process_eel_script vocalredisoBlurry.jsfx-template vocalredisoBlurry.test TEST | ||
process_eel_script vocalredisoBlurry.jsfx-template vocalredisoBlurry.eel EEL | ||
process_eel_script vocalredisoBlurry.jsfx-template vocalredisoBlurry.jsfx JSFX |
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,32 @@ | ||
# ensure latest testing script is available | ||
./process_scripts.sh | ||
|
||
# add defines to head of test script | ||
cat testing_defines.eel2 vocalrediso.test > vocalrediso.test.eel2 | ||
|
||
function run_test { | ||
local test_script="$1" | ||
local test_output | ||
|
||
echo "TESTING $1" | ||
|
||
# Ensure latest testing script is available | ||
./process_scripts.sh | ||
|
||
# Add defines to head of test script | ||
cat testing_defines.eel2 "$test_script" > "${test_script}.eel2" | ||
|
||
# Run the test and capture output | ||
test_output=$(./WDL/WDL/eel2/loose_eel "./${test_script}.eel2" 2>&1) | ||
echo "$test_output" | ||
|
||
# Get the last line of the output and check for failure | ||
if echo "$test_output" | tail -n 1 | grep -q "^FAILURE"; then | ||
echo "Failed Test Cases, will return -1!" | ||
exit -1 | ||
fi | ||
} | ||
|
||
# Run tests for each script | ||
run_test vocalrediso.test | ||
run_test vocalredisoBlurry.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
|
||
// Helper functions to check for positive infinity, negative infinity, and nan | ||
function is_pos_inf(x) ( | ||
(x * 2 == x) && x > 0; | ||
); | ||
function is_neg_inf(x) ( | ||
is_pos_inf(-x); | ||
); | ||
function is_nan(x) local(z1, z2) ( | ||
z2 = x; | ||
z1 = x + 1; | ||
z2 == 0 && z1 == 0; | ||
); | ||
|
||
function assert_equal_exact(expected, actual, message) global(failed_asserts, successful_asserts) ( | ||
is_nan(expected) && is_nan(actual) ? successful_asserts += 1 : | ||
(is_pos_inf(expected) && is_pos_inf(actual)) || (is_neg_inf(expected) && is_neg_inf(actual)) ? successful_asserts += 1 : | ||
expected !== actual ? ( | ||
fprintf(3, "\033[0;31mexpected: %g, was: %g. %s\033[0m\n", expected, actual, message); | ||
failed_asserts += 1; | ||
) : successful_asserts += 1; | ||
); | ||
|
||
function assert_equal_exact(expected, actual) global() ( | ||
assert_equal_exact(expected, actual, "values differ!") | ||
); | ||
|
||
function assert_near_equal(expected, tolerance, actual, message) global(failed_asserts, successful_asserts) ( | ||
is_nan(expected) || is_nan(actual) || is_nan(tolerance) ? successful_asserts += 1 : | ||
(is_pos_inf(expected) || is_neg_inf(expected)) && (is_pos_inf(actual) || is_neg_inf(actual)) ? successful_asserts += 1 : | ||
abs(expected - actual) > tolerance ? ( | ||
fprintf(3, "\033[0;31mexpected: %g (±%g), was: %g. %s\033[0m\n", expected, tolerance, actual, message); | ||
failed_asserts += 1; | ||
) : successful_asserts += 1; | ||
); | ||
|
||
function assert_near_equal(expected, tolerance, actual) global() ( | ||
assert_near_equal(expected, tolerance, actual, "values are not equal within tolerance!") | ||
); | ||
|
||
function assert_true(boolean, message) global(failed_asserts, successful_asserts) ( | ||
(!boolean) ? ( | ||
fprintf(3, "\033[0;31mexpected: true, was: false. %s\033[0m\n", message); | ||
failed_asserts += 1; | ||
) : successful_asserts += 1; | ||
); | ||
|
||
function assert_false(boolean, message) global(failed_asserts, successful_asserts) ( | ||
boolean ? ( | ||
fprintf(3, "\033[0;31mexpected: false, was: true. %s\033[0m\n", message); | ||
failed_asserts += 1; | ||
) : successful_asserts += 1; | ||
); | ||
|
||
function assert_true(boolean) global() ( | ||
assert_true(boolean, ""); | ||
); | ||
|
||
function assert_false(boolean) global() ( | ||
assert_false(boolean, ""); | ||
); | ||
|
||
function test_summary() global(failed_asserts successful_asserts) local(total) ( | ||
total = failed_asserts + successful_asserts; | ||
failed_asserts === 0 ? fprintf(3, "\033[0;32mAll %d asserts succeeded.\033[0m\n", total) : ( | ||
successful_asserts > 0 ? printf("\033[0;34m%d of %d asserts succeeded.\033[0m\n", successful_asserts, total); | ||
failed_asserts > 0 ? ( | ||
printf("\033[0;31m%d of %d asserts failed.\nFAILURE, see above!\033[0m\n", failed_asserts, total); | ||
) | ||
) | ||
); | ||
|
||
/* | ||
pif = 0; | ||
pif = 1/pif; | ||
nif = 0; | ||
nif = -1/nif; | ||
lg = 2^64; | ||
|
||
printf("z/z=%g, pif=%g, nif=%g\n", z/z, pif, nif); | ||
|
||
assert_true( is_pos_inf(pif), " +1/0 is +inf"); | ||
assert_false(is_neg_inf(pif), " +1/0 is -inf"); | ||
assert_false( is_nan(pif), " +1/0 is nan"); | ||
assert_false(is_pos_inf(nif), " -1/0 is +inf"); | ||
assert_true( is_neg_inf(nif), " -1/0 is -inf"); | ||
assert_false( is_nan(nif), " -1/0 is nan"); | ||
assert_false(is_pos_inf(z/z), " z/z is +inf"); | ||
assert_false(is_neg_inf(z/z), " z/z is -inf"); | ||
assert_true( is_nan(z/z), " z/z is nan"); | ||
assert_false(is_pos_inf( 0), " 0 is +inf"); | ||
assert_false(is_neg_inf( 0), " 0 is -inf"); | ||
assert_false( is_nan( 0), " 0 is nan"); | ||
assert_false(is_pos_inf( lg), " 2^64 is +inf"); | ||
assert_false(is_neg_inf( lg), " 2^64 is -inf"); | ||
assert_false( is_nan( lg), " 2^64 is nan"); | ||
assert_false(is_pos_inf(-lg), "-2^64 is +inf"); | ||
assert_false(is_neg_inf(-lg), "-2^64 is -inf"); | ||
assert_false( is_nan(-lg), "-2^64 is nan"); | ||
*/ | ||
|
||
// drop in for spl(channel) | ||
// function spl(channel) ( | ||
// 0 == channel ? spl0 : | ||
// 1 == channel ? spl1 : | ||
// 2 == channel ? spl2 : | ||
// 3 == channel ? spl3 : | ||
// 4 == channel ? spl4 : | ||
// 5 == channel ? spl5 : | ||
// 6 == channel ? spl6 : | ||
// 7 == channel ? spl7 : | ||
// 8 == channel ? spl8 : | ||
// 9 == channel ? spl9 : | ||
// 10 == channel ? spl10 : | ||
// 11 == channel ? spl11 : | ||
// 12 == channel ? spl12 : | ||
// 13 == channel ? spl13 : | ||
// 14 == channel ? spl14 : | ||
// 15 == channel ? spl15 : | ||
// 0; | ||
// ); | ||
// does not work for writes! |
Oops, something went wrong.