Skip to content
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

Add unit test for duplicate file names #443

Merged
merged 1 commit into from
Jun 10, 2024
Merged
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
4 changes: 2 additions & 2 deletions compiler/tools/fpp-to-dict/test/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ run_test()
else
outfile=$infile
fi
$fpp_to_dict $args $infile.fpp 2>&1
$fpp_to_dict $args $infile.fpp 2>&1 | remove_author | remove_path_prefix > $outfile.out.txt
}

. ./tests.sh
Expand All @@ -31,7 +31,7 @@ do
echo "
$t()
{
run_test $t
run_test '' $t
}"
done > default-tests.sh
. ./default-tests.sh
Expand Down
2 changes: 1 addition & 1 deletion compiler/tools/fpp-to-dict/test/scripts/update-ref.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ update()
else
outfile=$infile
fi
$fpp_to_dict $args $infile.fpp 2>&1
$fpp_to_dict $args $infile.fpp 2>&1 | remove_path_prefix > $outfile.ref.txt
}

for file in `find . -name '*.ref.txt'`
Expand Down
Empty file.
8 changes: 8 additions & 0 deletions compiler/tools/fpp-to-dict/test/top/duplicate.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module M {

topology Duplicate {
}
}

topology Duplicate {
}
9 changes: 9 additions & 0 deletions compiler/tools/fpp-to-dict/test/top/duplicate.ref.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fpp-to-dict
[ local path prefix ]/tools/fpp-to-dict/test/top/duplicate.fpp:7.1
topology Duplicate {
^
error: duplicate JSON file DuplicateTopologyDictionary.json
previous file would be generated here:
[ local path prefix ]/tools/fpp-to-dict/test/top/duplicate.fpp:3.3
topology Duplicate {
^
Empty file.
6 changes: 6 additions & 0 deletions compiler/tools/fpp-to-dict/test/top/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ dataProducts()
run_test "-i builtin.fpp -p 1.0.0 -f 3.4.3" dataProducts && \
validate_json_schema BasicDp && \
diff_json BasicDp
}

duplicate()
{
run_test '' duplicate && \
compare duplicate
}
1 change: 1 addition & 0 deletions compiler/tools/fpp-to-dict/test/top/tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tests="
multipleTops
dataProducts
duplicate
"
Loading