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 nia tests from Coq test-suite #46

Merged
merged 2 commits into from
May 25, 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
32 changes: 9 additions & 23 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.DEFAULT_GOAL := all

mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))

TIMED?=1
TIMING?=1
PYTHON?=python

export TIMED
export TIMING
Expand All @@ -20,30 +24,12 @@ COQ_VERSION_PREFIX = The Coq Proof Assistant, version
COQ_VERSION_FULL := $(subst $(COQ_VERSION_PREFIX),,$(shell $(COQBIN)coqc --version 2>/dev/null))
COQ_VERSION := $(firstword $(COQ_VERSION_FULL))

SKIP_FILES?=

SKIP_IF_NOT_NEW?=
include $(mkfile_dir)skip-old.mk

ifneq (,$(filter 8.11%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.11-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.11-older.txt
ifneq (,$(filter 8.10%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.10-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.10-older.txt
ifneq (,$(filter 8.9%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.9-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.9-older.txt
ifneq (,$(filter 8.8%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.8-older.txt $(SKIP_IF_NOT_NEW)
else
# new version, don't skip
endif
endif
endif
endif
$(mkfile_dir)skip-old.mk: generate-skip.py Makefile
rm -f $@
$(PYTHON) $< > $@
chmod a-w $@

ifneq (,$(SKIP_FILES))
GREP_INVOCATION:=| grep -v $(foreach f,$(SKIP_FILES),-f $(f))
Expand Down
886 changes: 886 additions & 0 deletions src/Nia.v

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions src/generate-skip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
from pathlib import Path
import os.path

SCRIPT_DIRECTORY = Path(__file__).parent

print("#" * 80)
print(f"# This file was autogenerated by `{Path(__file__).name}'")
print(f"# DO NOT MODIFY THIS FILE DIRECTLY")
print(f"# Instead modify `{Path(__file__).name}' and re-run `make'")
print("#" * 80)
print("")
print("SKIP_FILES?=")
print("")
print("SKIP_IF_NOT_NEW?=")
print("")
endifs = []
MIN_VER = 8
MAX_VER = 19
for ver in reversed(range(MIN_VER, MAX_VER + 1)):
fname = f"skip-8.{ver}-older.txt"
if not os.path.exists(SCRIPT_DIRECTORY / fname):
with open(SCRIPT_DIRECTORY / fname, "a") as f:
pass
print(f"ifneq (,$(filter 8.{ver}%,$(COQ_VERSION)))")
print(f"SKIP_FILES+=skip-8.{ver}-older.txt $(SKIP_IF_NOT_NEW)")
print("else")
if ver == MIN_VER:
print("# new version, don't skip")
else:
print(f"SKIP_IF_NOT_NEW+=skip-8.{ver}-older.txt")
endifs.append("endif")
print("\n".join(endifs))
Empty file added src/skip-8.12-older.txt
Empty file.
Empty file added src/skip-8.13-older.txt
Empty file.
Empty file added src/skip-8.14-older.txt
Empty file.
Empty file added src/skip-8.15-older.txt
Empty file.
Empty file added src/skip-8.16-older.txt
Empty file.
Empty file added src/skip-8.17-older.txt
Empty file.
Empty file added src/skip-8.18-older.txt
Empty file.
1 change: 1 addition & 0 deletions src/skip-8.19-older.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Nia.v
70 changes: 70 additions & 0 deletions src/skip-old.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
################################################################################
# This file was autogenerated by `generate-skip.py'
# DO NOT MODIFY THIS FILE DIRECTLY
# Instead modify `generate-skip.py' and re-run `make'
################################################################################

SKIP_FILES?=

SKIP_IF_NOT_NEW?=

ifneq (,$(filter 8.19%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.19-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.19-older.txt
ifneq (,$(filter 8.18%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.18-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.18-older.txt
ifneq (,$(filter 8.17%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.17-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.17-older.txt
ifneq (,$(filter 8.16%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.16-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.16-older.txt
ifneq (,$(filter 8.15%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.15-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.15-older.txt
ifneq (,$(filter 8.14%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.14-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.14-older.txt
ifneq (,$(filter 8.13%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.13-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.13-older.txt
ifneq (,$(filter 8.12%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.12-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.12-older.txt
ifneq (,$(filter 8.11%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.11-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.11-older.txt
ifneq (,$(filter 8.10%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.10-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.10-older.txt
ifneq (,$(filter 8.9%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.9-older.txt $(SKIP_IF_NOT_NEW)
else
SKIP_IF_NOT_NEW+=skip-8.9-older.txt
ifneq (,$(filter 8.8%,$(COQ_VERSION)))
SKIP_FILES+=skip-8.8-older.txt $(SKIP_IF_NOT_NEW)
else
# new version, don't skip
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
Loading