-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix #35 (XSectionGenerator::run not working)
- Added tests for API (run_api_tests.sh) - Version 1.10
- Loading branch information
Matthias Koefferlein
committed
Jun 3, 2024
1 parent
2da6cec
commit 1e67ff6
Showing
8 changed files
with
90 additions
and
4 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 |
---|---|---|
@@ -1 +1,4 @@ | ||
tests/run_dir | ||
.*.swp | ||
.*.swo | ||
klayout_crash.log |
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
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
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,42 @@ | ||
|
||
require "test/unit" | ||
require 'test/unit/ui/console/testrunner' | ||
|
||
# NOTE: these tests are more like smoke tests | ||
# For the real tests, see "run_tests.sh" | ||
|
||
class XSectionAPITest < Test::Unit::TestCase | ||
|
||
def test_run | ||
|
||
mw = RBA::MainWindow.instance | ||
mw.load_layout($input_file, 1) | ||
|
||
cv = RBA::CellView.active | ||
|
||
gen = XS::XSectionGenerator.new($xs_file) | ||
view = gen.run(RBA::DPoint.new(-1, 0), RBA::DPoint.new(1, 0), cv) | ||
|
||
assert_equal("(-0.042,-2.058;2.058,0.042)", view.box.to_s) | ||
|
||
end | ||
|
||
def test_run_multi | ||
|
||
mw = RBA::MainWindow.instance | ||
mw.load_layout($input_file, 1) | ||
|
||
cv = RBA::CellView.active | ||
|
||
gen = XS::XSectionGenerator.new($xs_file) | ||
view = gen.run_multi([[ RBA::DPoint.new(-1, 0), RBA::DPoint.new(0, 0) ], [ RBA::DPoint.new(0, 0), RBA::DPoint.new(1, 0) ]], cv) | ||
|
||
assert_equal("(-0.042,-2.058;2.058,0.042)", view.box.to_s) | ||
|
||
end | ||
|
||
end | ||
|
||
test_suite = XSectionAPITest.suite | ||
Test::Unit::UI::Console::TestRunner.run(test_suite) | ||
|
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,37 @@ | ||
#!/bin/bash -e | ||
|
||
export KLAYOUT_HOME=/dev/null | ||
|
||
def_path_win="$HOME/AppData/Roaming/KLayout" | ||
if [ -e "$def_path_win" ] && [ -d "$def_path_win" ]; then | ||
echo "Adding default installation path: $def_path_win" | ||
export PATH="$def_path_win:$PATH" | ||
fi | ||
|
||
# locate klayout binary | ||
for exe in klayout klayout_app.exe; do | ||
if which $exe 2>/dev/null; then | ||
klayout=$(which $exe) | ||
break | ||
fi | ||
done | ||
|
||
if [ "$klayout" = "" ]; then | ||
echo "No KLayout binary found in PATH .. please set path to point to klayout binary" | ||
exit 1 | ||
fi | ||
|
||
echo "Using KLayout binary from: $klayout" | ||
|
||
rm -rf run_dir | ||
mkdir -p run_dir | ||
|
||
failed="" | ||
|
||
bin=../src/macros/xsection.lym | ||
|
||
export KLAYOUT_PATH=../src | ||
export KLAYOUT_HOME=run_dir | ||
|
||
$klayout -nc -z -r api_tests.rb -rd xs_file=xs_etch1.xs -rd input_file=xs_test.gds | ||
|
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