@@ -15,11 +15,21 @@ source:
1515build :
1616 skip : true # [win]
1717 detect_python : False
18+ # ------------------------------------------------------------
19+ # 1) Build C++ with CMake, 2) Run CTest to exercise C++ tests,
20+ # 3) If CTest passes, install the binary into $PREFIX/bin
21+ # ------------------------------------------------------------
1822 script : |
1923 mkdir build
2024 cd build
21- cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX
25+
26+ # Configure & compile
27+ cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release
2228 cmake --build . --parallel ${CPU_COUNT:-1}
29+
30+ # Run C++ unit tests via CTest (fail the build if any test fails)
31+ ctest --output-on-failure
32+
2333 cmake --install . --prefix $PREFIX
2434 cd ..
2535 number : 0
@@ -46,9 +56,6 @@ outputs:
4656 - libcxx # [osx]
4757 - libgcc-ng # [linux]
4858
49- # No separate script: top‐level build already installed
50- # the C++ binary into $PREFIX/bin/aligncount_cpp
51-
5259 # ---------------------------------------------------------
5360 # Output #2: Noarch Python wrapper (aligncount_demo)
5461 # ---------------------------------------------------------
@@ -72,6 +79,20 @@ outputs:
7279 - python >=3.9,<3.14
7380 - {{ pin_subpackage("aligncount_cpp", exact=False) }}
7481
82+ test :
83+ requires :
84+ - pytest
85+
86+ # Copy in Python test file(s) from the repo. At test time,
87+ # Conda will have already installed “aligncount” (the
88+ # pure-Python wrapper) into the test environment, so the
89+ # test can import it.
90+ source_files :
91+ - ../tests/python/test_cli.py
92+
93+ # Invoke pytest on the copied file(s).
94+ commands :
95+ - pytest -q test_cli.py
7596
7697about :
7798 home : {{ REPO_HOME }}
0 commit comments