Skip to content

Move ethdebug cmdline tests into their own subdirectory #15995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions test/cmdlineTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,33 @@ do
test_name_filter+=(-and -not -name "$pattern")
done

# shellcheck disable=SC2207 # We do not support test names containing spaces.
all_tests=($(find . -mindepth 1 -maxdepth 2 -type d | \
while read -r dir; do
if ! find "$dir" -mindepth 1 -maxdepth 1 -type d | grep -q .; then
echo "${dir#./}"
fi
done
))

selected_tests=()
for test_path in "${all_tests[@]}"; do
num_matches=$(find "$test_path" -type d "${test_name_filter[@]}" | wc -l)
if [ "$num_matches" -ge 1 ]; then
selected_tests+=("$test_path")
fi
done
# NOTE: We want leading symbols in names to affect the sort order but without
# LC_COLLATE=C sort seems to ignore them.
# shellcheck disable=SC2207 # We do not support test names containing spaces.
selected_tests=($(find . -mindepth 1 -maxdepth 1 -type d "${test_name_filter[@]}" | cut -c 3- | LC_COLLATE=C sort))
selected_tests=($(printf '%s\n' "${selected_tests[@]}" | LC_COLLATE=C sort))

if (( ${#selected_tests[@]} == 0 ))
then
printWarning "The pattern '${test_name_filter[*]}' did not match any tests."
exit 0;
else
test_count=$(find . -mindepth 1 -maxdepth 1 -type d | wc -l)
test_count=$(printf '%s\n' "${all_tests[@]}" | wc -l)
printLog "Selected ${#selected_tests[@]} out of ${test_count} tests."
fi

Expand Down Expand Up @@ -367,7 +383,7 @@ printTask "Running general commandline tests..."
fi

# Strip trailing slash from $tdir.
tdir=$(basename "${tdir}")
tdir=${tdir%/}
if [[ $no_smt == true ]]
then
if [[ $tdir =~ .*model_checker_.* ]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
======= Debug Data (ethdebug/format/info/resources) =======
{"compilation":{"compiler":{"name":"solc","version": "<VERSION REMOVED>"},"sources":[{"id":0,"path":"ethdebug/ethdebug_eof_container_osaka/input.sol"}]}}

======= ethdebug/ethdebug_eof_container_osaka/input.sol:C =======
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sources": {
"C": {
"urls": [
"standard_yul_debug_info_ethdebug_compatible_output/in.yul"
"ethdebug/standard_yul_debug_info_ethdebug_compatible_output/in.yul"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sources": {
"C": {
"urls": [
"standard_yul_debug_info_ethdebug_incompatible_output/in.yul"
"ethdebug/standard_yul_debug_info_ethdebug_incompatible_output/in.yul"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sources": {
"C": {
"urls": [
"standard_yul_debug_info_ethdebug_verbatim_unimplemented/in.yul"
"ethdebug/standard_yul_debug_info_ethdebug_verbatim_unimplemented/in.yul"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_ethdebug_assign_immutable/in.yul"]}
"C": {"urls": ["ethdebug/standard_yul_ethdebug_assign_immutable/in.yul"]}
},
"settings": {
"outputSelection": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_ethdebug_ir/in.yul"]}
"C": {"urls": ["ethdebug/standard_yul_ethdebug_bytecode_ir/in.yul"]}
},
"settings": {
"outputSelection": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_ethdebug_bytecode_iroptimized/in.yul"]}
"C": {"urls": ["ethdebug/standard_yul_ethdebug_bytecode_iroptimized/in.yul"]}
},
"settings": {
"outputSelection": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_ethdebug_deployed_bytecode/in.yul"]}
"C": {"urls": ["ethdebug/standard_yul_ethdebug_deployed_bytecode/in.yul"]}
},
"settings": {
"outputSelection": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_ethdebug_deployed_bytecode/in.yul"]}
"C": {"urls": ["ethdebug/standard_yul_ethdebug_deployed_bytecode/in.yul"]}
},
"settings": {
"outputSelection": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_ethdebug_bytecode_ir/in.yul"]}
"C": {"urls": ["ethdebug/standard_yul_ethdebug_ir/in.yul"]}
},
"settings": {
"outputSelection": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_ethdebug_iroptimize/in.yul"]}
"C": {"urls": ["ethdebug/standard_yul_ethdebug_iroptimize/in.yul"]}
},
"settings": {
"outputSelection": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_ethdebug_optimize_ir/in.yul"]}
"C": {"urls": ["ethdebug/standard_yul_ethdebug_optimize_ir/in.yul"]}
},
"settings": {
"optimizer": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"language": "Yul",
"sources": {
"C": {"urls": ["standard_yul_ethdebug_optimize_iroptimized/in.yul"]}
"C": {"urls": ["ethdebug/standard_yul_ethdebug_optimize_iroptimized/in.yul"]}
},
"settings": {
"optimizer": {
Expand Down
4 changes: 0 additions & 4 deletions test/cmdlineTests/ethdebug_eof_container_osaka/output

This file was deleted.