forked from Nbickford/REAPERDenoiser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic compilation test, no testing yet
- Loading branch information
1 parent
ce7e02c
commit a1b64ff
Showing
8 changed files
with
176 additions
and
2 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 |
---|---|---|
@@ -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,5 @@ MigrationBackup/ | |
|
||
# Fody - auto-generated XML schema | ||
FodyWeavers.xsd | ||
|
||
*.test.eel2 |
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
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,44 @@ | ||
cat testing_defines.eel2 > REAPERDenoiser.test.eel2 | ||
sed -r -e 's/^(desc|slider[0-9]+|(in|out)_pin):.*|^@(init|slider|block|serialize|sample)//' \ | ||
-e 's/\/\/DEBUGPRINT/printf/' \ | ||
-e 's/\/\/IFTEST|\/\*IFTEST\{\*|\*\}IFTEST\*\///' \ | ||
-e 's/\*IFNTEST\*|IFNTEST\{\*|\*\}IFNTEST//' \ | ||
REAPERDenoiser >> REAPERDenoiser.test.eel2 | ||
|
||
# Initialize a flag to indicate stderr output | ||
stderr_output=0 | ||
|
||
output=$(./WDL/WDL/eel2/loose_eel ./REAPERDenoiser.test.eel2 2>&1) | ||
|
||
echo "$output" | ||
|
||
# Get the last line of the output | ||
last_line=$(echo "$output" | tail -n 1) | ||
|
||
# Check if the last line starts with 'FAILURE' | ||
if echo "$last_line" | grep -q "^FAILURE"; then | ||
echo "Failed Test Cases, will return -1!" | ||
exit -1 | ||
fi | ||
|
||
##//DEBUGPRINT("HI"); | ||
##//IFTEST code_here(); | ||
##/*IFTEST{* | ||
## more_code(); | ||
##*}IFTEST*/ | ||
##/*IFNTEST*/called_when_not_testing(); | ||
##/*IFNTEST{*/ | ||
## also_called_when_not_testing(); | ||
##/*}IFNTEST*/ | ||
|
||
# will transform to | ||
|
||
##printf("HI"); | ||
## code_here(); | ||
## | ||
## more_code(); | ||
## | ||
##//called_when_not_testing(); | ||
##/*IFNTEST{*/ | ||
## also_called_when_not_testing(); | ||
##/*IFNTEST}*/ |
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,84 @@ | ||
|
||
// Helper functions to check for positive infinity, negative infinity, and nan | ||
function is_pos_inf(x) (x == 1/0); | ||
function is_neg_inf(x) (x == -1/0); | ||
function is_nan(x) (x != x;); | ||
|
||
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); | ||
) | ||
) | ||
); | ||
|
||
// 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; | ||
); |