Skip to content

Commit

Permalink
fix Blurry, better testing
Browse files Browse the repository at this point in the history
should fix some glitches
  • Loading branch information
micsthepick committed Feb 29, 2024
1 parent a8373ce commit 6e0c4f9
Show file tree
Hide file tree
Showing 9 changed files with 2,502 additions and 559 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,5 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd

*.test.eel2
*.test.eel2
*.test
16 changes: 16 additions & 0 deletions process_scripts.sh
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
76 changes: 32 additions & 44 deletions test_eel.sh
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@
cat testing_defines.eel2 > vocalrediso.test.eel2
sed -r -e 's/^(desc|slider[0-9]+):.*|^@(init|slider|block|serialize|sample)//' \
-e 's/\/\/DEBUGPRINT/printf/' \
-e 's/\/\/IFTEST|\/\*IFTEST\{\*|\*\}IFTEST\*\///' \
-e 's/\*IFNTEST\*|IFNTEST\{\*|\*\}IFNTEST//' \
vocalrediso-jamesdsp.eel >> vocalrediso.test.eel2

# Initialize a flag to indicate stderr output
stderr_output=0

output=$(./WDL/WDL/eel2/loose_eel ./vocalrediso.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}*/
# 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
Loading

0 comments on commit 6e0c4f9

Please sign in to comment.