Skip to content

Commit

Permalink
Integrate test-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
elegios committed May 31, 2023
1 parent cf25557 commit 5435fa6
Show file tree
Hide file tree
Showing 30 changed files with 381 additions and 701 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/*
!build/tup.config
_*
\#*
\.\#*
Expand Down
36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
BOOT_NAME=boot
BOOT_NAME=mi-boot
MI_LITE_NAME=mi-lite
MI_MID_NAME=mi-mid
MI_NAME=mi
MI_CHEAT_NAME=mi-cheat

BIN_PATH=$(HOME)/.local/bin
LIB_PATH=$(HOME)/.local/lib/mcore
Expand All @@ -14,23 +15,19 @@ SET_OCAMLPATH=OCAMLPATH=$(current_dir)/build/lib
.PHONY: default
default: bootstrap

# Misc and cleanup

build:
mkdir -p build

# NOTE(vipa, 2023-03-29): This removes all ignored files, which
# should coincide with generated files
.PHONY: clean
clean:
rm -rf $$(misc/repo-ignored-files)
bash -c 'mapfile -t args < <(misc/repo-ignored-files); rm -rf "$${args[@]}"'
find build -depth -type d -empty -delete

# The OCaml library and executables (`boot`)

.PHONY: boot
boot: build/$(BOOT_NAME)
build/$(BOOT_NAME): build $(shell find src/boot/ -type f)
misc/with-tmp-dir dune build --root=src/boot/ --build-dir="{}" "&&" dune install --prefix="{}/install-prefix" --root=src/boot/ --bindir=`pwd`/build --libdir=`pwd`/build/lib ">/dev/null" "2>&1"
build/$(BOOT_NAME): $(shell find src/boot/ -type f)
misc/with-tmp-dir dune build --root=src/boot/ --build-dir="{}" "&&" dune install --build-dir="{}" --prefix="{}/install-prefix" --root=src/boot/ --libdir=`pwd`/build/lib ">/dev/null" "2>&1" "&&" mv "{}/install-prefix/bin/boot" $@

.PHONY: install-boot
install-boot:
Expand Down Expand Up @@ -60,6 +57,11 @@ build/$(MI_MID_NAME): build/$(MI_LITE_NAME)
build/$(MI_NAME): build/$(MI_MID_NAME)
$(SET_STDLIB) $(SET_OCAMLPATH) time build/$(MI_MID_NAME) compile src/main/mi.mc --output build/$(MI_NAME)

.PHONY: cheat
cheat: build/$(MI_CHEAT_NAME)
build/$(MI_CHEAT_NAME): build/$(BOOT_NAME)
$(SET_STDLIB) $(SET_OCAMLPATH) time mi compile src/main/mi.mc --output build/$(MI_CHEAT_NAME)

# Installing and uninstalling `mi` and the standard library

.PHONY: install
Expand All @@ -71,22 +73,20 @@ install: build/$(MI_NAME) install-boot

.PHONY: uninstall
uninstall:
cd src/boot && dune uninstall
misc/with-tmp-dir dune uninstall --build-dir="{}" --root=src/boot
rm -f $(BIN_PATH)/$(MI_NAME)
rm -rf $(LIB_PATH)/stdlib

# Basic testing (for more granular control, use `misc/test` directly)
# Basic testing (for more granular control, use `misc/test` directly,
# or `misc/watch` to autorun tests when files change)

.PHONY: test test-all test-quick
test test-all test-quick: $(if $(wildcard .tup/.),,build/$(MI_NAME))
test:
misc/test smart
exec misc/test --bootstrapped smart

test-all:
misc/test all
exec misc/test --bootstrapped all

test-quick:
misc/test

# TODO(vipa, 2023-03-28): write two things:
# - .mc program that outputs commands on how to build/run all tests, and does dependency checking
# - A shell script `misc/test` that evals the .mc program appropriately
exec misc/test --bootstrapped
168 changes: 0 additions & 168 deletions Makefile.old

This file was deleted.

11 changes: 0 additions & 11 deletions Tupfile

This file was deleted.

Empty file added build/tup.config
Empty file.
10 changes: 0 additions & 10 deletions make.bat

This file was deleted.

Loading

0 comments on commit 5435fa6

Please sign in to comment.