Download tests/test_segment_map_cpp.py from kimjunhan/vkgs-sim: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/kimjunhan/vkgs-sim/resolve/main/tests/test_segment_map_cpp.py
- Command line
-
hf download hf://kimjunhan/vkgs-sim/tests/test_segment_map_cpp.py
-
curl -L -o test_segment_map_cpp.py https://huggingface.co/kimjunhan/vkgs-sim/resolve/main/tests/test_segment_map_cpp.py
1.05 kB
| """src/vkgs/src/segment_map.hpp (๊ตฌ๊ฐ ๋ชจ๋ธ ์ด์ด ๋ฌ๋ฆฌ๊ธฐ์ ์ ํ ๋ก์ง) ์ g++ ๋ก ์ปดํ์ผํด ์ํํ๋ค. ์ฐฝ์ ๋์ฐ์ง ์๋๋ค.""" | |
| import os | |
| import shutil | |
| import subprocess | |
| from pathlib import Path | |
| import pytest | |
| ROOT = Path(__file__).resolve().parents[1] | |
| CXX = os.environ.get("CXX") or "g++" | |
| def test_segment_map(tmp_path): | |
| lines = ["# ์ํ"] | |
| for k in range(3): | |
| lines.append(f"S {k} {100 * (k + 1)} {50.0 * k} 0 0 /a b/seg{k}/point_cloud.ply") | |
| for k in range(3): | |
| lines += [f"P {k} {x} 0" for x in range(50 * k, 50 * k + 50)] | |
| f = tmp_path / "segments.txt" | |
| f.write_text("\n".join(lines) + "\n") | |
| exe = tmp_path / "t" | |
| subprocess.run([CXX, "-std=c++20", "-O1", "-I", str(ROOT / "src/vkgs/src"), | |
| str(ROOT / "tests/cpp/test_segment_map.cpp"), "-o", str(exe)], check=True) | |
| r = subprocess.run([str(exe), str(f)], capture_output=True, text=True) | |
| assert r.returncode == 0, r.stdout + r.stderr | |