Skip to content
Closed
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
42 changes: 42 additions & 0 deletions .github/workflows/moocore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,45 @@ jobs:
name: failed-tests-${{ matrix.os }}-${{ matrix.cc }}-${{ github.run_id }}
path: failed-test-outputs/
if-no-files-found: ignore

test-windows:
if: "! contains(github.event.head_commit.message, '[skip ci]')"
name: Run testsuite on windows-latest with MSVC
runs-on: windows-latest
env:
PYTHONUTF8: 1
steps:
- name: Checkout moocore
uses: actions/checkout@v6
with:
repository: multi-objective/moocore
sparse-checkout: c

- name: Checkout testsuite
uses: actions/checkout@v6
with:
path: testsuite

- uses: ilammy/msvc-dev-cmd@v1

- uses: actions/setup-python@v6
with:
python-version: '3.x'

- name: Install dependencies
run: python -m pip install -r testsuite/requirements.txt

- name: Build moocore (MSVC)
shell: bash
run: make -C c all CC=cl DEBUG=1

- name: Run testsuite
# Default shell (PowerShell) on purpose: no Unix tools are required.
run: |
foreach ($t in "dominatedsets","eaf","epsilon","hv","hvapprox","igd","ndsort","nondominated") {
Push-Location "testsuite/$t"
python ../regtest.py "$env:GITHUB_WORKSPACE/bin/$t"
$rc = $LASTEXITCODE
Pop-Location
if ($rc -ne 0) { exit $rc }
}
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,38 @@ This is a testsuite for [`moocore`](https://github.com/multi-objective/moocore).

[testsuite-badge]: https://github.com/multi-objective/testsuite/actions/workflows/moocore.yml/badge.svg
[testsuite-link]: https://github.com/multi-objective/testsuite/actions/workflows/moocore.yml

Running the testsuite
---------------------

```bash
pip install -r requirements.txt
cd hv && ../regtest.py ../../moocore/bin/hv
```

`regtest.py PROGRAM [TESTS]` runs the `*.test` files in the current directory (recursively) using `PROGRAM`.
The `*.test` files do not call platform-specific utilities directly but use the environment variables
`$XZCAT`, `$SORT`, `$CAT_SQUEEZE` and `$MKTEMP`. On Linux/macOS they default to `xzcat`, `sort`, `cat -s` and `mktemp`
and can be overridden from the environment.

Windows
-------

The testsuite runs on Windows with the executables of `moocore` built with MSVC.
`regtest.py` only needs Python and `joblib` (see `requirements.txt`); no Unix utilities are required.
On Windows, `regtest.py`:

* runs the `*.test` files with a built-in minimal interpreter (variables, `|`, `<`, `>`, `echo`, `rm`) instead of a shell, and
* uses the portable Python scripts in [`tools/`](tools) for `$XZCAT`, `$SORT`, `$CAT_SQUEEZE` and `$MKTEMP`.

moocore's makefile adds the `.exe` extension to the executables, and `regtest.py` appends it if missing, so these are equivalent:

```bat
rem From a Visual Studio developer prompt (or after ilammy/msvc-dev-cmd)
make -C moocore\c all CC=cl
cd testsuite\hv
python ..\regtest.py ..\..\moocore\bin\hv
python ..\regtest.py ..\..\moocore\bin\hv.exe
```

Set `REGTEST_PORTABLE=1` to use this Windows code path on Linux/macOS (useful for debugging).
8 changes: 4 additions & 4 deletions eaf/eafdiff-ALG_1_dat_ALG_2_dat.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
file1=$(mktemp)
file2=$(mktemp)
xzcat ../data/ALG_1_dat.xz > $file1
xzcat ../data/ALG_2_dat.xz > $file2
file1=$($MKTEMP)
file2=$($MKTEMP)
${XZCAT} ../data/ALG_1_dat.xz > $file1
${XZCAT} ../data/ALG_2_dat.xz > $file2
${PROGRAM} -d $file1 $file2
rm -f $file1 $file2
2 changes: 1 addition & 1 deletion eaf/input1.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
${PROGRAM} --quiet -i- ../data/input1.dat | sort | cat -s
${PROGRAM} --quiet -i- ../data/input1.dat | ${SORT} | ${CAT_SQUEEZE}
2 changes: 1 addition & 1 deletion eaf/ran.1000pts.3d.10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
${PROGRAM} --quiet ../data/ran.1000pts.3d.10 | sort | cat -s
${PROGRAM} --quiet ../data/ran.1000pts.3d.10 | ${SORT} | ${CAT_SQUEEZE}
2 changes: 1 addition & 1 deletion eaf/spherical-3d-2000pts-10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.dat.xz | $PROGRAM --quiet | sort -s | cat -s
${XZCAT} ../data/${TESTNAME}.dat.xz | $PROGRAM --quiet | ${SORT} -s | ${CAT_SQUEEZE}
8 changes: 4 additions & 4 deletions epsilon/rmnk_0.0_10_16_1_0_random_search_1.txt.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
reference=$(mktemp)
xzcat ../data/rmnk_0.0_10_16_1_0_ref.txt.xz > $reference
xzcat ../data/${TESTNAME}.xz | ${PROGRAM} -r $reference --additive
xzcat ../data/${TESTNAME}.xz | ${PROGRAM} -r $reference --additive --maximise
reference=$($MKTEMP)
${XZCAT} ../data/rmnk_0.0_10_16_1_0_ref.txt.xz > $reference
${XZCAT} ../data/${TESTNAME}.xz | ${PROGRAM} -r $reference --additive
${XZCAT} ../data/${TESTNAME}.xz | ${PROGRAM} -r $reference --additive --maximise
rm -f $reference
2 changes: 1 addition & 1 deletion hv/ran.40000pts.3d.1.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.xz | ${PROGRAM} -r "10 10 10" --union
${XZCAT} ../data/${TESTNAME}.xz | ${PROGRAM} -r "10 10 10" --union
2 changes: 1 addition & 1 deletion hv/ran.40001pts.3d.1.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.xz | ${PROGRAM} -r "10 10 10" --union
${XZCAT} ../data/${TESTNAME}.xz | ${PROGRAM} -r "10 10 10" --union
2 changes: 1 addition & 1 deletion hv/rep5d.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ${TESTNAME}.inp.xz | $PROGRAM -r "-14300 -14300 -14300 -14300 -14300"
${XZCAT} ${TESTNAME}.inp.xz | $PROGRAM -r "-14300 -14300 -14300 -14300 -14300"
2 changes: 1 addition & 1 deletion hv/test2D-200k.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.inp.xz | $PROGRAM -r "-117751 -117751"
${XZCAT} ../data/${TESTNAME}.inp.xz | $PROGRAM -r "-117751 -117751"
8 changes: 4 additions & 4 deletions igd/ALG_1_ALG_2.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tmpfile1=$(mktemp -u)
tmpfile2=$(mktemp -u)
xzcat ../data/ALG_1_dat.xz > "$tmpfile1"
xzcat ../data/ALG_2_dat.xz > "$tmpfile2"
tmpfile1=$($MKTEMP -u)
tmpfile2=$($MKTEMP -u)
${XZCAT} ../data/ALG_1_dat.xz > "$tmpfile1"
${XZCAT} ../data/ALG_2_dat.xz > "$tmpfile2"
echo "# (1,2)"
${PROGRAM} --all -r "$tmpfile1" "$tmpfile2"
${PROGRAM} --all --maximise -r "$tmpfile1" "$tmpfile2"
Expand Down
4 changes: 2 additions & 2 deletions igd/spherical-3d-2000pts-10.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tmpfile=$(mktemp -u)
xzcat ../data/${TESTNAME}.dat.xz > "$tmpfile"
tmpfile=$($MKTEMP -u)
${XZCAT} ../data/${TESTNAME}.dat.xz > "$tmpfile"
${PROGRAM} --all -r "$tmpfile" "$tmpfile"
rm -f "$tmpfile"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$PROGRAM < ../data/${TESTNAME} --union --quiet --filter | sort -b
$PROGRAM < ../data/${TESTNAME} --union --quiet --filter | ${SORT} -b
2 changes: 1 addition & 1 deletion nondominated/DTLZLinearShape.3d.front.1000pts.10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$PROGRAM < ../data/${TESTNAME} --union --quiet --filter | sort -b
$PROGRAM < ../data/${TESTNAME} --union --quiet --filter | ${SORT} -b
2 changes: 1 addition & 1 deletion nondominated/DTLZLinearShape.6d.front.700pts.10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.xz | $PROGRAM --union --quiet --filter | sort -b
${XZCAT} ../data/${TESTNAME}.xz | $PROGRAM --union --quiet --filter | ${SORT} -b
2 changes: 1 addition & 1 deletion nondominated/DTLZSphereShape.3d.front.1000pts.10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$PROGRAM < ../data/${TESTNAME} --union --quiet --filter | sort -b
$PROGRAM < ../data/${TESTNAME} --union --quiet --filter | ${SORT} -b
2 changes: 1 addition & 1 deletion nondominated/DTLZSphereShape.5d.front.1000pts.10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$PROGRAM < ../data/${TESTNAME} --union --quiet --filter | sort -b
$PROGRAM < ../data/${TESTNAME} --union --quiet --filter | ${SORT} -b
2 changes: 1 addition & 1 deletion nondominated/DTLZSphereShape.6d.front.1000pts.10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.xz | $PROGRAM --union --quiet --filter | sort -b
${XZCAT} ../data/${TESTNAME}.xz | $PROGRAM --union --quiet --filter | ${SORT} -b
2 changes: 1 addition & 1 deletion nondominated/ran.1000pts.3d.10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../eaf/${TESTNAME}.exp.xz | $PROGRAM --union --quiet --filter | sort -b
${XZCAT} ../eaf/${TESTNAME}.exp.xz | $PROGRAM --union --quiet --filter | ${SORT} -b
2 changes: 1 addition & 1 deletion nondominated/ran.1300pts.5d.10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.xz | $PROGRAM --maximise --union --quiet --filter | sort -b
${XZCAT} ../data/${TESTNAME}.xz | $PROGRAM --maximise --union --quiet --filter | ${SORT} -b
2 changes: 1 addition & 1 deletion nondominated/ran.40000pts.3d.1.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.xz | $PROGRAM --verbose
${XZCAT} ../data/${TESTNAME}.xz | $PROGRAM --verbose
2 changes: 1 addition & 1 deletion nondominated/ran.9000pts.4d.10.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.xz | $PROGRAM --maximise --union --quiet --filter | sort -b
${XZCAT} ../data/${TESTNAME}.xz | $PROGRAM --maximise --union --quiet --filter | ${SORT} -b
2 changes: 1 addition & 1 deletion nondominated/rmnk_0.0_10_16_1_0_random_search_1.txt.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.xz | $PROGRAM --union --verbose
${XZCAT} ../data/${TESTNAME}.xz | $PROGRAM --union --verbose
2 changes: 1 addition & 1 deletion nondominated/test2D-200k.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xzcat ../data/${TESTNAME}.inp.xz | $PROGRAM --quiet --filter | sort -b -s
${XZCAT} ../data/${TESTNAME}.inp.xz | $PROGRAM --quiet --filter | ${SORT} -b -s
Loading