diff --git a/.gitignore b/.gitignore index 934a6bc87..8ee6a10dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build/* +!build/tup.config _* \#* \.\#* diff --git a/Makefile b/Makefile index d5079c6d5..c8d690d4c 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/Makefile.old b/Makefile.old deleted file mode 100644 index 17b710903..000000000 --- a/Makefile.old +++ /dev/null @@ -1,168 +0,0 @@ -################################################### -# Miking is licensed under the MIT license. -# Copyright (C) David Broman. See file LICENSE.txt -# -# To make the build system platform independent, -# all scripts are done in OCaml instead of being -# dependent on make. If make is installed on -# the system, we just run the batch make.sh file. -################################################### - -.PHONY :\ - all\ - boot\ - install-boot\ - build\ - build-mi\ - install\ - lite\ - lint\ - fix\ - clean\ - uninstall\ - test\ - test-all\ - test-boot-compile\ - test-boot-compile-all\ - test-compile\ - test-compile-all\ - test-all-prune-utests\ - test-boot-compile-prune-utests\ - test-boot-compile-prune-utests-all\ - test-compile-prune-utests\ - test-compile-prune-utests-all\ - test-run\ - test-run-all\ - test-run-boot\ - test-run-boot-all\ - test-boot\ - test-boot-all\ - test-boot-py\ - test-par\ - test-tune\ - test-sundials\ - test-ipopt\ - test-accelerate\ - test-jvm - -all: build - -boot: - @./make.sh boot - -install-boot: boot - @./make.sh install-boot - -lite: boot - @./make.sh lite - -test: test-boot - -build: boot -# Run the complete bootstrapping process to compile `mi`. - @./make.sh - -build-mi: -# Build `mi` using the current version in `build`, skipping bootstrapping. -# The result is named `build/mi-tmp`. - @./make.sh build-mi - -install: build install-boot - @./make.sh install - -lint: - @./make.sh lint - -fix: - @./make.sh fix - -clean: - @./make.sh clean - -uninstall: - @./make.sh uninstall - -# Tests everything except some files with very special external dependencies -test-all:\ - test-boot-all\ - test-compile\ - test-run\ - test-js\ - test-tune\ - test-jvm - @./make.sh lint - -# The same as test-all but prunes utests whose external dependencies are not met -# on this system -test-all-prune-utests:\ - test-boot-all\ - test-compile-prune-utests\ - test-run\ - test-tune - @./make.sh lint - -test-boot-compile: boot - @$(MAKE) -s -f test-boot-compile.mk selected - -test-boot-compile-all: boot - @$(MAKE) -s -f test-boot-compile.mk all - -test-compile: build - @$(MAKE) -s -f test-compile.mk selected - -test-compile-all: build - @$(MAKE) -s -f test-compile.mk all - -test-boot-compile-prune-utests: boot - @$(MAKE) -s -f test-boot-compile-prune-utests.mk selected - -test-boot-compile-prune-utests-all: boot - @$(MAKE) -s -f test-boot-compile-prune-utests.mk all - -test-compile-prune-utests: build - @$(MAKE) -s -f test-compile-prune-utests.mk selected - -test-compile-prune-utests-all: build - @$(MAKE) -s -f test-compile-prune-utests.mk all - -test-run: build - @$(MAKE) -s -f test-run.mk selected - -test-run-all: build - @$(MAKE) -s -f test-run.mk all - -test-boot-run: boot - @$(MAKE) -s -f test-boot-run.mk selected - -test-boot-run-all: boot - @$(MAKE) -s -f test-boot-run.mk all - -test-boot: boot - @$(MAKE) -s -f test-boot.mk selected - -test-boot-py: boot - @$(MAKE) -s -f test-boot.mk py - -test-boot-all: boot - @$(MAKE) -s -f test-boot.mk all - -test-par: build - @$(MAKE) -s -f test-par.mk - -test-tune: build - @$(MAKE) -s -f test-tune.mk - -test-sundials: build - @$(MAKE) -s -f test-sundials.mk - -test-ipopt: build - @$(MAKE) -s -f test-ipopt.mk - -test-accelerate: build - @$(MAKE) -s -f test-accelerate.mk - -test-jvm: build - @$(MAKE) -s -f test-jvm.mk - -test-js: build - @$(MAKE) -s -f test-js.mk diff --git a/Tupfile b/Tupfile deleted file mode 100644 index 947e3c697..000000000 --- a/Tupfile +++ /dev/null @@ -1,11 +0,0 @@ -STDLIB := MCORE_LIBS=stdlib=`pwd`/src/stdlib - -: |> ^ cd src/boot; dune build^ tmp=`mktemp -d` && cd src/boot && if dune build --build-dir $tmp; then cd ../../; cp $tmp/install/default/bin/boot %o; rm -rf $tmp; else rm -rf $tmp; false; fi |> build/tup/boot - -: src/main/mi-lite.mc | build/tup/boot |> ^ build/tup/boot eval %f -- 0 %f %o^ $(STDLIB) build/tup/boot eval %f -- 0 %f %o |> build/tup/mi-lite -: src/main/mi.mc | build/tup/mi-lite |> ^ build/tup/mi-lite 1 %f %o^ $(STDLIB) build/tup/mi-lite 1 %f %o |> build/tup/mi1 -: src/main/mi.mc | build/tup/mi1 |> ^ build/tup/mi1 compile %f --output %o^ $(STDLIB) build/tup/mi1 compile %f --output %o |> build/tup/mi - -: src/main/mi.mc |> ^ mi compile %f --output %o^ $(STDLIB) mi compile %f --output %o |> build/tup/mi-cheat - -include misc/tup-gen diff --git a/build/tup.config b/build/tup.config new file mode 100644 index 000000000..e69de29bb diff --git a/make.bat b/make.bat deleted file mode 100644 index ba94559f0..000000000 --- a/make.bat +++ /dev/null @@ -1,10 +0,0 @@ -:: ################################################### -:: Miking is licensed under the MIT license. -:: Copyright (C) David Broman. See file LICENSE.txt -:: -:: To make the build system platform independent, -:: all scripts are done in Ocaml instead of being -:: dependent on Make. -:: ################################################### - -@ocaml build\build.ml %1 %2 %3 diff --git a/make.sh b/make.sh deleted file mode 100755 index 402b5ec6d..000000000 --- a/make.sh +++ /dev/null @@ -1,214 +0,0 @@ -#!/bin/sh -################################################### -# Miking is licensed under the MIT license. -# Copyright (C) David Broman. See file LICENSE.txt -# -# To make the build system platform independent, -# building is done using Dune and called from -# this bash script (on UNIX platforms) or -# using make.bat (on Windows). -################################################### - -# Forces the script to exit on error -set -e - -BOOT_NAME=boot -MI_NAME=mi -MI_LITE_NAME=mi-lite -MI_TMP_NAME=mi-tmp - -BIN_PATH=$HOME/.local/bin -LIB_PATH=$HOME/.local/lib/mcore - -# Setup environment variable to find standard library -# (and set test namespace for testing) -export MCORE_LIBS=stdlib=`pwd`/stdlib:test=`pwd`/test - -# Setup dune/ocamlfind to use local boot library when available -export OCAMLPATH=`pwd`/build/lib - -# Compile and build the boot interpreter -build_boot(){ - dune build - dune install --prefix=build --bindir=`pwd`/build > /dev/null 2>&1 -} - -install_boot(){ - dune install > /dev/null 2>&1 -} - -# Compile a new version of the compiler using the current one -build_mi() { - if [ -e build/$MI_NAME ] - then - time build/$MI_NAME compile src/main/mi.mc - mv -f $MI_NAME build/$MI_TMP_NAME - else - echo "No existing compiler binary was found." - echo "Try running the bootstrapping phase first!" - fi -} - -# Build the Miking compiler -build() { - if [ -e build/$MI_NAME ] - then - echo "Bootstrapped compiler already exists. Run 'make clean' before to recompile. " - else - echo "Bootstrapping the Miking compiler (1st round, might take a few minutes)" - time build/$BOOT_NAME eval src/main/mi-lite.mc -- 0 src/main/mi-lite.mc ./$MI_LITE_NAME - echo "Bootstrapping the Miking compiler (2nd round, might take some more time)" - time ./$MI_LITE_NAME 1 src/main/mi.mc ./$MI_NAME - echo "Bootstrapping the Miking compiler (3rd round, might take some more time)" - time ./$MI_NAME compile src/main/mi.mc - mv -f $MI_NAME build/$MI_NAME - rm -f $MI_LITE_NAME - fi -} - -# As build(), but skips the third bootstrapping step -lite() { - if [ -e build/$MI_NAME ] - then - echo "Bootstrapped compiler already exists. Run 'make clean' before to recompile. " - else - echo "Bootstrapping the Miking compiler (1st round, might take a few minutes)" - time build/$BOOT_NAME eval src/main/mi-lite.mc -- 0 src/main/mi-lite.mc ./$MI_LITE_NAME - echo "Bootstrapping the Miking compiler (2nd round, might take some more time)" - time ./$MI_LITE_NAME 1 src/main/mi.mc ./$MI_NAME - mv -f $MI_NAME build/$MI_NAME - rm -f $MI_LITE_NAME - fi -} - - -# Install the Miking compiler -install() { - if [ -e build/$MI_NAME ]; then - rm -rf $LIB_PATH/stdlib - mkdir -p $BIN_PATH $LIB_PATH - cp -rf stdlib $LIB_PATH - cp -f build/$MI_NAME $BIN_PATH - else - echo "No existing compiler binary was found." - echo "Try compiling the project first!" - fi -} - -# Uninstall the Miking bootstrap interpreter and compiler -uninstall() { - set +e - dune uninstall > /dev/null 2>&1 - rm -f $BIN_PATH/$MI_NAME - rm -rf $LIB_PATH/stdlib - set -e -} - -# Lint ocaml source code -lint () { - dune build @fmt -} - -# lints and then fixes ocaml source code -fix () { - dune build @fmt --auto-promote -} - -compile_test () { - set +e - binary=$(mktemp) - output=$1 - compile="$2 --output $binary" - output="$output\n$($compile $1 2>&1)" - exit_code=$? - if [ $exit_code -eq 0 ] - then - output="$output$($binary)" - exit_code=$? - rm $binary - if [ $exit_code -ne 0 ] - then - echo "ERROR: the compiled binary for $1 exited with $exit_code" - exit 1 - fi - else - echo "ERROR: command '$compile $1 2>&1' exited with $exit_code" - rm $binary - exit 1 - fi - echo "$output\n" - set -e -} - -run_test_prototype() { - set +e - output=$2 - output="$output\n$($1 $2 2>&1)\n" - echo $output - set -e -} - -run_test() { - run_test_prototype "build/mi run --test --disable-prune-warning" $1 -} - -run_test_boot() { - run_test_prototype "build/boot eval src/main/mi.mc -- run --test --disable-prune-warning" $1 -} - -run_js_test() { - ./test/js/make.sh run-test-quiet $1 -} - -run_js_web_test() { - ./test/js/web/make.sh run-test-quiet $1 -} - -case $1 in - boot) - build_boot - ;; - lite) - lite - ;; - install-boot) - install_boot - ;; - build-mi) - build_mi - ;; - run-test) - run_test "$2" - ;; - run-test-boot) - run_test_boot "$2" - ;; - compile-test) - compile_test "$2" "$3" - ;; - run-js-test) - run_js_test "$2" - ;; - run-js-web-test) - run_js_web_test "$2" - ;; - lint) - lint - ;; - fix) - fix - ;; - install) - install - ;; - uninstall) - uninstall - ;; - clean) - rm -rf _build - rm -rf build - ;; - all | *) - build - ;; -esac diff --git a/misc/gen-tup-rules b/misc/gen-tup-rules index 223760ce7..4963c8401 100755 --- a/misc/gen-tup-rules +++ b/misc/gen-tup-rules @@ -2,12 +2,13 @@ set -e -if [ misc/test-spec -ot misc/test-spec.mc ]; then - if which mi >/dev/null 2>&1; then - MCORE_STDLIB=$(pwd)/src/stdlib mi compile misc/test-spec.mc --output misc/test-spec - else - MCORE_STDLIB=$(pwd)/src/stdlib build/mi compile misc/test-spec.mc --output misc/test-spec - fi -fi - -misc/test-spec --tup-rules > misc/tup-gen +DIR=$(dirname "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )") +TARGETDIR=$(realpath --relative-to="$DIR" .) +cd "$DIR" + +# NOTE(vipa, 2023-05-17): Tup doesn't like it if we write to files +# here, since this script is only supposed to list build targets, thus +# we don't check if test-spec is up to date here, even if it would +# make some form of sense to do so. + +misc/test-spec --tup-rules -- "$TARGETDIR" diff --git a/misc/test b/misc/test new file mode 100755 index 000000000..ff85873b7 --- /dev/null +++ b/misc/test @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +set -e + +DIR=$(dirname "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )") +TARGETDIR=$(realpath --relative-to="$DIR" .) +cd "$DIR" + +# TODO(vipa, 2023-05-15): We later want to transform arguments given +# after "--" to be resolved relative to $TARGETDIR but given to +# test-spec as relative to $DIR, but I don't know how to do that +# conveniently in bash atm, so I'm leaving it for now. +if [ ! "$DIR" -ef "$TARGETDIR" ]; then + echo "ERROR: this test script only knows how to run tests while the working directory is the root of the repository." + exit 1 +fi + +export OCAMLPATH=$DIR/build/lib +export MCORE_LIBS=stdlib=$DIR/src/stdlib + +if [ misc/test-spec -ot misc/test-spec.mc ]; then + if command -v mi >/dev/null 2>&1; then + mi compile misc/test-spec.mc --output misc/test-spec + else + build/mi compile misc/test-spec.mc --output misc/test-spec + fi +fi + +if command -v tup >/dev/null 2>&1; then + if [ -d ".tup" ]; then + useTup=1 + else + useTup=0 + echo "'tup' installed, but not initialized. Run 'tup init' if you want to use 'tup'." + fi +else + useTup=0 +fi + +if [ $useTup -eq 1 ]; then + echo "Using 'tup' as a test runner" + tmp=$(mktemp) + if ! misc/test-spec --tup-filter "$@" > "$tmp"; then + cat "$tmp" + rm "$tmp" + exit 1 + fi + mapfile -t args < "$tmp" + rm "$tmp" + exec tup "${args[@]}" +else + echo "Using 'make' as a test runner" + exec make -f <(misc/test-spec --make "$@") +fi diff --git a/misc/test-spec.mc b/misc/test-spec.mc index ec046b6c6..151f91e26 100644 --- a/misc/test-spec.mc +++ b/misc/test-spec.mc @@ -1,3 +1,15 @@ +/- + +This program is written to have single source of truth for all our +tests, in a way that is easy to modify as we get more tests, and that +also works with multiple test runners (presently `make` and `tup`). + +The file starts with a public API, then internals, then at the end +(after `mexpr`) is the code using the API. New tests and exceptions +are to be added there. + +-/ + include "sys.mc" include "stringid.mc" include "arg.mc" @@ -53,10 +65,13 @@ con ConditionsUnmet : () -> ConditionStatus -- listed) con ConditionsImpossible : () -> ConditionStatus +-- `MidCmd` and `EndCmd` are the types of functions that you can call +-- to register a new command to run as part of our testing. +-- A `MidCmd` registers a command with one input and one output. type MidCmd = {input : Path, cmd : String, tag : String} -> Path +-- An `EndCmd` registers a command with one input and no outputs. type EndCmd = {input : Path, cmd : String, tag : String} -> () - type Subdirs con IncludeSubs : () -> Subdirs con OnlyHere : () -> Subdirs @@ -75,6 +90,11 @@ type TestApi = , glob : [String] -> Subdirs -> File -> [Path] } +-- Example: +-- glob ["stdlib", "parser"] (IncludeSubs ()) (SuffixFile ".mc") +-- is equivalent with the following bash-style glob: +-- stdlib/parser/**/*.mc + type TestCollection = -- The name of this set of tests, i.e., how it is identified on the -- commandline. Must be unique, and preferably without spaces or @@ -154,11 +174,6 @@ let testColl : String -> TestCollection = lam name. , newTests = lam. () } --- Example: --- glob ["stdlib", "parser"] (IncludeSubs ()) (SuffixFile ".mc") --- is equivalent with the following bash-style glob: --- stdlib/parser/**/*.mc - ------------------------------------------------------------------- -- The public API ends here, with one exception: `testMain` is also -- considered public @@ -176,8 +191,9 @@ let _drop = lam n. lam s. subsequence s n (subi (length s) n) let _restrictToDir : [String] -> Glob -> Option Glob = lam dirs. lam glob. let fixedGlob = {glob with dirs = tail dirs, subdirs = OnlyHere ()} in - if isPrefix eqString (cons "src" glob.dirs) dirs then - let remainingDirs = _drop (length glob.dirs) dirs in + let actualGlobDirs = cons "src" glob.dirs in + if isPrefix eqString actualGlobDirs dirs then + let remainingDirs = _drop (length actualGlobDirs) dirs in switch (remainingDirs, glob.subdirs) case ([], _) then Some fixedGlob case (_, IncludeSubs _) then Some fixedGlob @@ -282,7 +298,7 @@ let _glob then filter (lam p. setMem p files) paths else paths in map stringToPath paths - else printLn "empty glob"; [] + else [] let _minER : ExpectedResult -> ExpectedResult -> ExpectedResult = lam a. lam b. switch (a, b) @@ -400,20 +416,21 @@ let testMain : [TestCollection] -> () = lam colls. -- TODO(vipa, 2023-05-12): For now assume we're always running in -- the root dir let root = "." in + let pathDirs = lam p. switch p + case OrigPath x then x.path.0 + case DerivPath x then cons "build" x.orig.path.0 + end in + let pathDir = lam p. strJoin "/" (pathDirs p) in + let pathBasename = lam p. switch p + case OrigPath x then x.path.1 + case DerivPath x then join [x.orig.path.1, ".", x.testColl, ".", _miModeToString x.mode, ".", x.tag] + end in let dir = match options.mode with TupRules _ then match files with [dir] ++ _ then Some (strSplit "/" dir) else Some [] else None () in match - let pathDirs = lam p. switch p - case OrigPath x then x.path.0 - case DerivPath x then cons "build" x.orig.path.0 - end in - let pathBasename = lam p. switch p - case OrigPath x then x.path.1 - case DerivPath x then join [x.orig.path.1, ".", x.testColl, ".", _miModeToString x.mode, ".", x.tag] - end in match dir with Some dirs then let srcDir = match dirs with ["src"] ++ dirs then strJoin "/" (map (lam. "..") dirs) @@ -425,10 +442,10 @@ let testMain : [TestCollection] -> () = lam colls. let pathToString = lam p. utest pathDirs p with dirs in pathBasename p in - (srcDir, pathToString) + ({src = srcDir, root = strJoin "/" (map (lam. "..") dirs)}, pathToString) else - (concat root "/src/", lam p. strJoin "/" (snoc (pathDirs p) (pathBasename p))) - with (srcDirStr, pathToString) in + ({src = concat root "/src/", root = root}, lam p. strJoin "/" (snoc (pathDirs p) (pathBasename p))) + with (commandPath, pathToString) in let globBase = { root = root @@ -522,15 +539,25 @@ let testMain : [TestCollection] -> () = lam colls. , _expandFormat spec.friendlyCommand {i="$<", o="$@"} ) case TupRules _ then - ( _expandFormat spec.command {i="%f", o="%o"} - , _expandFormat spec.friendlyCommand {i="%f", o="%o"} + ( _expandFormat spec.command {i="%f", o="%3o"} + , _expandFormat spec.friendlyCommand {i="%f", o="%3o"} ) case _ then (spec.command, spec.friendlyCommand) end with (command, friendlyCommand) in + let firstLogIdx = if spec.output then 2 else 1 in + let stdoutStr = match options.mode with TupRules _ + then "%1o" + else pathToString stdout in + let stderrStr = match options.mode with TupRules _ + then "%2o" + else pathToString stderr in + let elideCat = match options.mode with TupRules _ + then "$(ROOT)/misc/elide-cat" + else "misc/elide-cat" in let command = join - [ "{ ", command, "; } >'", pathToString stdout, "' 2>'", pathToString stderr - , "' || { misc/elide-cat stdout '", pathToString stdout, "'; misc/elide-cat stderr '", pathToString stderr, "'; false; }" + [ "{ ", command, "; } >'", stdoutStr, "' 2>'", stderrStr + , "' || { ", elideCat, " stdout '", stdoutStr, "'; ", elideCat, " stderr '", stderrStr, "'; false; }" ] in let cmd = { input = spec.input @@ -589,12 +616,11 @@ let testMain : [TestCollection] -> () = lam colls. -- NOTE(vipa, 2023-03-31): Add targets for each mi version used let addTargets = lam mkMi. lam mkSh. - let normalExceptions = deref normalExceptions in let addNormals = let mi = mkMi "normal" in let sh = mkSh "normal" in lam src. - let tasks = optionGetOr defaultTasks (mapLookup src normalExceptions) in + let tasks = optionGetOr defaultTasks (mapLookup src (deref normalExceptions)) in switch tasks.compile case Dont _ then () case Fail _ then @@ -623,13 +649,15 @@ let testMain : [TestCollection] -> () = lam colls. iter addNormals (glob [] (IncludeSubs ()) (SuffixFile ".mc")) in _phase "target api"; - -- TODO(vipa, 2023-05-12): continue from here + let ocamlPath = match options.mode with TupRules _ + then " OCAMLPATH=$(VARIANT_SRC)/lib " + else " OCAMLPATH=\\$(pwd)/build/lib " in (if options.bootstrapped then let mi = match options.mode with TupRules _ then "%" else "build/mi" in let mkMi = mkMi - { pre = join ["MCORE_LIBS=stdlib=", srcDirStr, "/stdlib ", mi] + { pre = join ["MCORE_LIBS=stdlib=", commandPath.src, "/stdlib", ocamlPath, mi] , mode = MiBoot () } in let mkSh = mkSh (MiBoot ()) in @@ -638,7 +666,7 @@ let testMain : [TestCollection] -> () = lam colls. _phase "bootstrapped"; (if options.installed then let mkMi = mkMi - { pre = join ["MCORE_LIBS=stdlib=", srcDirStr, "/stdlib mi"] + { pre = join ["MCORE_LIBS=stdlib=", commandPath.src, "/stdlib mi"] , mode = MiInstalled () } in let mkSh = mkSh (MiInstalled ()) in @@ -650,7 +678,7 @@ let testMain : [TestCollection] -> () = lam colls. then "%" else "build/mi-cheat" in let mkMi = mkMi - { pre = join ["MCORE_LIBS=stdlib=", srcDirStr, "/stdlib ", mi] + { pre = join ["MCORE_LIBS=stdlib=", commandPath.src, "/stdlib", ocamlPath, mi] , mode = MiCheat () } in let mkSh = mkSh (MiCheat ()) in @@ -658,20 +686,25 @@ let testMain : [TestCollection] -> () = lam colls. else ()); _phase "cheated"; + (if null (deref commands) then + printLn "Found no matching tests (maybe a deactivated test collection?)"; + exit 1 + else ()); + switch options.mode case TupRules _ then let printRule = lam c. let extra = switch c.miMode - case MiBoot _ then join [" | ", srcDirStr, "/"] + case MiBoot _ then join [" | ", commandPath.src, "/ ", commandPath.src, "/"] case MiInstalled _ then "" - case MiCheat _ then join [" | ", srcDirStr, "/"] + case MiCheat _ then join [" | ", commandPath.src, "/ ", commandPath.src, "/"] end in let cmd = join [ ": ", pathToString c.input, extra , " |> ^ ", c.friendlyCommand, "^ " - , c.command, " |>" + , c.command, " |> " + , pathToString c.stdout, " ", pathToString c.stderr , optionMapOr "" (lam p. cons ' ' (pathToString p)) c.output - , " | ", pathToString c.stdout, " ", pathToString c.stderr ] in printLn cmd in iter printRule (deref commands); @@ -683,7 +716,13 @@ let testMain : [TestCollection] -> () = lam colls. case Make _ then let printPrereq = lam c. let o = optionGetOr c.stdout c.output in - print (join [" ", pathToString o]) in + print (cons ' ' (pathToString o)) in + let printPhony = lam c. + let o = optionGetOr c.stdout c.output in + match c.input with OrigPath _ + then print (cons ' ' (pathToString o)) + else () + in let printRule = lam c. let o = optionGetOr c.stdout c.output in let extra = switch c.miMode @@ -693,13 +732,18 @@ let testMain : [TestCollection] -> () = lam colls. end in let cmd = join [ pathToString o, " : ", pathToString c.input, "\n" - , "\t", c.command + , "\t@echo ", c.friendlyCommand, "\n" + , "\t@mkdir -p ", pathDir c.stdout, "\n" + , "\t@", c.command ] in printLn cmd in print "test:"; iter printPrereq (deref commands); printLn ""; + print ".PHONY:"; + iter printPhony (deref commands); + printLn ""; iter printRule (deref commands); _phase "make" end @@ -711,8 +755,7 @@ testMain with checkCondition = lam. if and (sysCommandExists "nvcc") (sysCommandExists "futhark") then ConditionsMet () - -- else ConditionsImpossible () -- TODO(vipa, 2023-04-25): figure out how to check if we have nvidia hardware - else ConditionsUnmet () -- TODO(vipa, 2023-04-25): temporarily pretend they're not impossible, to test `newTests` + else ConditionsImpossible () -- TODO(vipa, 2023-04-25): figure out how to check if we have nvidia hardware , exclusions = lam api. -- NOTE(vipa, 2023-04-25): Accelerate isn't supported in -- interpreted mode, and compiled mode is already tested via the @@ -725,4 +768,65 @@ testMain let exe = api.mi.m {input = mc, cmd = "compile --debug-accelerate %i --output %o", tag = "debug-exe"} in api.sh.e {input = exe, cmd = "%i", tag = "debug-run"}) } + + , { testColl "exceptions" + with exclusions = lam api. + let runFail = {defaultTasks with interpret = Fail (), run = Fail ()} in + let unsupported = {defaultTasks with interpret = Fail (), compile = Fail ()} in + let dontRun = {defaultTasks with run = Dont ()} in + let markExact = lam tasks. lam path. + print ""; -- TODO(vipa, 2023-05-16): Commenting out this line makes it so this entire function disappears (dead-code elim presumably) + match strSplit "/" path with dirs ++ [file] in + api.mark tasks (api.glob dirs (OnlyHere ()) (ExactFile file)) in + + -- Files that are expected to fail + iter (markExact runFail) + [ "test/examples/utest.mc" + ]; + + -- Python is only supported in boot + iter (markExact unsupported) + [ "stdlib/python/python.mc" + , "test/py/python.mc" + ]; + + -- This doesn't seem to terminate in a reasonable amount of time + iter (markExact dontRun) + [ "test/examples/async/tick.mc" + ]; + + () + } + + , { testColl "microbenchmark" + with exclusions = lam api. + -- NOTE(vipa, 2023-05-16): These are tested via new tests instead + api.mark noTasks (api.glob ["test", "microbenchmark"] (IncludeSubs ()) (SuffixFile ".mc")) + , newTests = lam api. + for_ (api.glob ["test", "microbenchmark"] (IncludeSubs ()) (SuffixFile ".mc")) (lam mc. + let exe = api.mi.m {input = mc, cmd = "compile %i --test --output %o", tag = "exe"} in + -- NOTE(vipa, 2023-05-16): We arbitrarily run with argument 1, + -- since we're just testing, not benchmarking + api.mi.e {input = mc, cmd = "eval --test %i -- 1", tag = "eval"}; + api.sh.e {input = exe, cmd = "%i 1", tag = "run"}) + } + + , { testColl "constraint-programming" + with checkCondition = lam. + if sysCommandExists "minizinc" + then ConditionsMet () + else ConditionsUnmet () + , conditionalInclusions = lam api. + api.mark defaultTasks (api.glob ["stdlib", "cp"] (IncludeSubs ()) (SuffixFile ".mc")) + } + + , { testColl "tuning" + with exclusions = lam api. + -- NOTE(vipa, 2023-05-16): + api.mark noTasks (api.glob ["test", "examples", "tuning"] (IncludeSubs ()) (SuffixFile ".mc")) + , newTests = lam api. + for_ (api.glob ["test", "examples", "tuning"] (IncludeSubs ()) (SuffixFile ".mc")) (lam mc. + let exe = api.mi.m {input = mc, cmd = "tune %i --test --disable-optimizations --compile --disable-exit-early --enable-cleanup --output %o", tag = "exe"} in + api.sh.e {input = exe, cmd = "./%i", tag = "run"}) + } ] diff --git a/misc/watch b/misc/watch new file mode 100755 index 000000000..01f9a885c --- /dev/null +++ b/misc/watch @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +DIR=$(dirname "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )") + +"$DIR/misc/repo-files" | entr -rc "$DIR/misc/test" "$@" diff --git a/src/Tupdefault b/src/Tupdefault new file mode 100644 index 000000000..2bcca106c --- /dev/null +++ b/src/Tupdefault @@ -0,0 +1,3 @@ +include_rules + +run $(ROOT)/misc/gen-tup-rules diff --git a/src/Tupfile b/src/Tupfile new file mode 100644 index 000000000..a263517b5 --- /dev/null +++ b/src/Tupfile @@ -0,0 +1,139 @@ +include_rules + +STDLIB := MCORE_LIBS=stdlib=$(ROOT)/src/stdlib OCAMLPATH=$(ROOT)/build/src/lib + +# NOTE(vipa, 2023-05-16): This is ugly, but appears stable and does +# seem to work +BOOT_LIB_FILES += lib/boot/META +BOOT_LIB_FILES += lib/boot/ast.ml +BOOT_LIB_FILES += lib/boot/boot.a +BOOT_LIB_FILES += lib/boot/boot.cma +BOOT_LIB_FILES += lib/boot/boot.cmi +BOOT_LIB_FILES += lib/boot/boot.cmt +BOOT_LIB_FILES += lib/boot/boot.cmx +BOOT_LIB_FILES += lib/boot/boot.cmxa +BOOT_LIB_FILES += lib/boot/boot.ml +BOOT_LIB_FILES += lib/boot/boot__Ast.cmi +BOOT_LIB_FILES += lib/boot/boot__Ast.cmt +BOOT_LIB_FILES += lib/boot/boot__Ast.cmx +BOOT_LIB_FILES += lib/boot/boot__Bootparser.cmi +BOOT_LIB_FILES += lib/boot/boot__Bootparser.cmt +BOOT_LIB_FILES += lib/boot/boot__Bootparser.cmx +BOOT_LIB_FILES += lib/boot/boot__Builtin.cmi +BOOT_LIB_FILES += lib/boot/boot__Builtin.cmt +BOOT_LIB_FILES += lib/boot/boot__Builtin.cmx +BOOT_LIB_FILES += lib/boot/boot__Deadcode.cmi +BOOT_LIB_FILES += lib/boot/boot__Deadcode.cmt +BOOT_LIB_FILES += lib/boot/boot__Deadcode.cmx +BOOT_LIB_FILES += lib/boot/boot__Eval.cmi +BOOT_LIB_FILES += lib/boot/boot__Eval.cmt +BOOT_LIB_FILES += lib/boot/boot__Eval.cmx +BOOT_LIB_FILES += lib/boot/boot__Ext.cmi +BOOT_LIB_FILES += lib/boot/boot__Ext.cmt +BOOT_LIB_FILES += lib/boot/boot__Ext.cmx +BOOT_LIB_FILES += lib/boot/boot__Exttest.cmi +BOOT_LIB_FILES += lib/boot/boot__Exttest.cmt +BOOT_LIB_FILES += lib/boot/boot__Exttest.cmx +BOOT_LIB_FILES += lib/boot/boot__Intrinsics.cmi +BOOT_LIB_FILES += lib/boot/boot__Intrinsics.cmt +BOOT_LIB_FILES += lib/boot/boot__Intrinsics.cmti +BOOT_LIB_FILES += lib/boot/boot__Intrinsics.cmx +BOOT_LIB_FILES += lib/boot/boot__Lexer.cmi +BOOT_LIB_FILES += lib/boot/boot__Lexer.cmt +BOOT_LIB_FILES += lib/boot/boot__Lexer.cmx +BOOT_LIB_FILES += lib/boot/boot__Mexpr.cmi +BOOT_LIB_FILES += lib/boot/boot__Mexpr.cmt +BOOT_LIB_FILES += lib/boot/boot__Mexpr.cmx +BOOT_LIB_FILES += lib/boot/boot__Mlang.cmi +BOOT_LIB_FILES += lib/boot/boot__Mlang.cmt +BOOT_LIB_FILES += lib/boot/boot__Mlang.cmx +BOOT_LIB_FILES += lib/boot/boot__Msg.cmi +BOOT_LIB_FILES += lib/boot/boot__Msg.cmt +BOOT_LIB_FILES += lib/boot/boot__Msg.cmx +BOOT_LIB_FILES += lib/boot/boot__Parser.cmi +BOOT_LIB_FILES += lib/boot/boot__Parser.cmt +BOOT_LIB_FILES += lib/boot/boot__Parser.cmti +BOOT_LIB_FILES += lib/boot/boot__Parser.cmx +BOOT_LIB_FILES += lib/boot/boot__Parserutils.cmi +BOOT_LIB_FILES += lib/boot/boot__Parserutils.cmt +BOOT_LIB_FILES += lib/boot/boot__Parserutils.cmx +BOOT_LIB_FILES += lib/boot/boot__Patterns.cmi +BOOT_LIB_FILES += lib/boot/boot__Patterns.cmt +BOOT_LIB_FILES += lib/boot/boot__Patterns.cmx +BOOT_LIB_FILES += lib/boot/boot__Pprint.cmi +BOOT_LIB_FILES += lib/boot/boot__Pprint.cmt +BOOT_LIB_FILES += lib/boot/boot__Pprint.cmx +BOOT_LIB_FILES += lib/boot/boot__Pyast.cmi +BOOT_LIB_FILES += lib/boot/boot__Pyast.cmt +BOOT_LIB_FILES += lib/boot/boot__Pyast.cmx +BOOT_LIB_FILES += lib/boot/boot__Pyffi.cmi +BOOT_LIB_FILES += lib/boot/boot__Pyffi.cmt +BOOT_LIB_FILES += lib/boot/boot__Pyffi.cmx +BOOT_LIB_FILES += lib/boot/boot__Pypprint.cmi +BOOT_LIB_FILES += lib/boot/boot__Pypprint.cmt +BOOT_LIB_FILES += lib/boot/boot__Pypprint.cmx +BOOT_LIB_FILES += lib/boot/boot__Repl.cmi +BOOT_LIB_FILES += lib/boot/boot__Repl.cmt +BOOT_LIB_FILES += lib/boot/boot__Repl.cmx +BOOT_LIB_FILES += lib/boot/boot__Rope.cmi +BOOT_LIB_FILES += lib/boot/boot__Rope.cmt +BOOT_LIB_FILES += lib/boot/boot__Rope.cmti +BOOT_LIB_FILES += lib/boot/boot__Rope.cmx +BOOT_LIB_FILES += lib/boot/boot__Symbolize.cmi +BOOT_LIB_FILES += lib/boot/boot__Symbolize.cmt +BOOT_LIB_FILES += lib/boot/boot__Symbolize.cmx +BOOT_LIB_FILES += lib/boot/boot__Symbutils.cmi +BOOT_LIB_FILES += lib/boot/boot__Symbutils.cmt +BOOT_LIB_FILES += lib/boot/boot__Symbutils.cmx +BOOT_LIB_FILES += lib/boot/boot__Tensor.cmi +BOOT_LIB_FILES += lib/boot/boot__Tensor.cmt +BOOT_LIB_FILES += lib/boot/boot__Tensor.cmti +BOOT_LIB_FILES += lib/boot/boot__Tensor.cmx +BOOT_LIB_FILES += lib/boot/boot__Ustring.cmi +BOOT_LIB_FILES += lib/boot/boot__Ustring.cmt +BOOT_LIB_FILES += lib/boot/boot__Ustring.cmti +BOOT_LIB_FILES += lib/boot/boot__Ustring.cmx +BOOT_LIB_FILES += lib/boot/boot__Utils.cmi +BOOT_LIB_FILES += lib/boot/boot__Utils.cmt +BOOT_LIB_FILES += lib/boot/boot__Utils.cmx +BOOT_LIB_FILES += lib/boot/bootparser.ml +BOOT_LIB_FILES += lib/boot/builtin.ml +BOOT_LIB_FILES += lib/boot/deadcode.ml +BOOT_LIB_FILES += lib/boot/dune-package +BOOT_LIB_FILES += lib/boot/eval.ml +BOOT_LIB_FILES += lib/boot/ext.ml +BOOT_LIB_FILES += lib/boot/exttest.ml +BOOT_LIB_FILES += lib/boot/intrinsics.ml +BOOT_LIB_FILES += lib/boot/intrinsics.mli +BOOT_LIB_FILES += lib/boot/lexer.ml +BOOT_LIB_FILES += lib/boot/mexpr.ml +BOOT_LIB_FILES += lib/boot/mlang.ml +BOOT_LIB_FILES += lib/boot/msg.ml +BOOT_LIB_FILES += lib/boot/opam +BOOT_LIB_FILES += lib/boot/parser.ml +BOOT_LIB_FILES += lib/boot/parser.mli +BOOT_LIB_FILES += lib/boot/parserutils.ml +BOOT_LIB_FILES += lib/boot/patterns.ml +BOOT_LIB_FILES += lib/boot/pprint.ml +BOOT_LIB_FILES += lib/boot/pyast.ml +BOOT_LIB_FILES += lib/boot/pyffi.ml +BOOT_LIB_FILES += lib/boot/pypprint.ml +BOOT_LIB_FILES += lib/boot/repl.ml +BOOT_LIB_FILES += lib/boot/rope.ml +BOOT_LIB_FILES += lib/boot/rope.mli +BOOT_LIB_FILES += lib/boot/symbolize.ml +BOOT_LIB_FILES += lib/boot/symbutils.ml +BOOT_LIB_FILES += lib/boot/tensor.ml +BOOT_LIB_FILES += lib/boot/tensor.mli +BOOT_LIB_FILES += lib/boot/ustring.ml +BOOT_LIB_FILES += lib/boot/ustring.mli +BOOT_LIB_FILES += lib/boot/utils.ml +BOOT_LIB_FILES += lib/boot/boot.cmxs + +: |> ^b dune build^ ../misc/with-tmp-dir dune build --root=boot/ --build-dir="{}" "&&" cd . "&&" dune install --build-dir="{}" --prefix="{}/install-prefix" --root=boot/ --libdir=\$(realpath $(VARIANT_SRC)/lib) ">/dev/null" "2>&1" "&&" mv "{}/install-prefix/bin/boot" %1o |> mi-boot | $(BOOT_LIB_FILES) + +: main/mi-lite.mc | mi-boot $(BOOT_LIB_FILES) |> ^ ./boot eval %f -- 0 %f %o^ $(STDLIB) ./%1i eval %f -- 0 %f %o |> mi-lite +: main/mi.mc | mi-lite $(BOOT_LIB_FILES) |> ^ ./mi-lite 1 %f %o^ $(STDLIB) ./%1i 1 %f %o |> mi1 +: main/mi.mc | mi1 $(BOOT_LIB_FILES) |> ^ ./mi1 compile %f --output %o^ $(STDLIB) ./%1i compile %f --output %o |> mi + +: main/mi.mc | mi-boot $(BOOT_LIB_FILES) |> ^ mi compile %f --output %o^ $(STDLIB) mi compile %f --output %o |> mi-cheat diff --git a/src/Tuprules.tup b/src/Tuprules.tup new file mode 100644 index 000000000..64093707f --- /dev/null +++ b/src/Tuprules.tup @@ -0,0 +1,7 @@ +ROOT := $(TUP_CWD)/.. +VARIANT_SRC := $(TUP_VARIANTDIR) + +export OPAM_SWITCH_PREFIX +export CAML_LD_LIBRARY_PATH +export OCAML_TOPLEVEL_PATH +export PKG_CONFIG_PATH diff --git a/test-accelerate.mk b/test-accelerate.mk deleted file mode 100644 index 5ba98a6a6..000000000 --- a/test-accelerate.mk +++ /dev/null @@ -1,9 +0,0 @@ -include test-files.mk - -.PHONY: all $(accelerate_files) - -all: $(accelerate_files) - -$(accelerate_files): - @./make.sh compile-test $@ "build/mi compile --debug-accelerate" - @./make.sh compile-test $@ "build/mi compile --accelerate" diff --git a/test-boot-compile-prune-utests.mk b/test-boot-compile-prune-utests.mk deleted file mode 100644 index 8a878e7c1..000000000 --- a/test-boot-compile-prune-utests.mk +++ /dev/null @@ -1,10 +0,0 @@ -include test-files.mk - -.PHONY: all selected $(src_files_all) - -all: $(src_files_all) - -selected: $(compile_files_prune) - -$(src_files_all): - @./make.sh compile-test $@ "build/boot eval src/main/mi.mc -- compile --test --disable-optimizations" diff --git a/test-boot-compile.mk b/test-boot-compile.mk deleted file mode 100644 index 3c2474040..000000000 --- a/test-boot-compile.mk +++ /dev/null @@ -1,10 +0,0 @@ -include test-files.mk - -.PHONY: all selected $(src_files_all) - -all: $(src_files_all) - -selected: $(compile_files) - -$(src_files_all): - @./make.sh compile-test $@ "build/boot eval src/main/mi.mc -- compile --test --disable-optimizations --disable-prune-utests" diff --git a/test-boot-run.mk b/test-boot-run.mk deleted file mode 100644 index cc2245556..000000000 --- a/test-boot-run.mk +++ /dev/null @@ -1,10 +0,0 @@ -include test-files.mk - -.PHONY: all selected $(src_files_all) - -all: $(src_files_all) - -selected: $(run_files) - -$(src_files_all): - @./make.sh run-test-boot $@ diff --git a/test-boot.mk b/test-boot.mk deleted file mode 100644 index e10778328..000000000 --- a/test-boot.mk +++ /dev/null @@ -1,15 +0,0 @@ -include test-files.mk - -BOOT_NAME = boot - -.PHONY: all selected py $(src_files_all) - -all: $(src_files_all) - -selected: $(boot_files) - -py: $(python_files) - -# File rule -$(src_files_all): - @MCORE_LIBS=stdlib=`pwd`/stdlib:test=`pwd`/test build/${BOOT_NAME} eval --test --disable-prune-warning $@ diff --git a/test-compile-prune-utests.mk b/test-compile-prune-utests.mk deleted file mode 100644 index 2710b9ed1..000000000 --- a/test-compile-prune-utests.mk +++ /dev/null @@ -1,10 +0,0 @@ -include test-files.mk - -.PHONY: all selected $(src_files_all) - -all: $(src_files_all) - -selected: $(compile_files_prune) - -$(src_files_all): - @./make.sh compile-test $@ "build/mi compile --test --disable-optimizations" diff --git a/test-compile.mk b/test-compile.mk deleted file mode 100644 index 833bbb39a..000000000 --- a/test-compile.mk +++ /dev/null @@ -1,10 +0,0 @@ -include test-files.mk - -.PHONY: all selected $(src_files_all) - -all: $(src_files_all) - -selected: $(compile_files) - -$(src_files_all): - @./make.sh compile-test $@ "build/mi compile --test --disable-optimizations --disable-prune-utests" diff --git a/test-files.mk b/test-files.mk deleted file mode 100644 index 82b4601de..000000000 --- a/test-files.mk +++ /dev/null @@ -1,91 +0,0 @@ -# All relevant source files to include in the tests (plus Java tests) -src_files_all_tmp =\ - $(wildcard stdlib/*.mc)\ - $(wildcard stdlib/**/*.mc)\ - $(wildcard test/mexpr/*.mc)\ - $(wildcard test/mlang/*.mc)\ - $(wildcard test/py/*.mc) - -# Exclude the tests in the JVM directory, as they depend on Java being -# installed. -jvm_files = $(wildcard stdlib/jvm/*.mc) -src_files_all =\ - $(filter-out $(jvm_files), $(src_files_all_tmp)) - -# These programs has special external dependencies which might be tedious to -# install or are mutually exclusive with other dependencies. -sundials_files = $(wildcard stdlib/sundials/*.mc) -ipopt_files = $(wildcard stdlib/ipopt/*.mc) -accelerate_files = $(wildcard test/examples/accelerate/*.mc) -cuda_files = $(wildcard test/examples/accelerate/cuda/*.mc) -futhark_files = $(wildcard test/examples/accelerate/futhark/*.mc) - -special_dependencies_files +=\ - $(sundials_files)\ - $(ipopt_files)\ - $(accelerate_files) - - -# These are special, special cases since the python externals are implemented -# differently from other externals and can therefore not be compiled. -python_files += stdlib/python/python.mc -python_files += $(wildcard test/py/*.mc) - - -# Test programs for the JavaScript backend. These should be compiled with mi -# and runned with node.js, the result being compared to the original program -# being runned with the Miking compiler. All Miking test programs should have -# the same output as the compiled JavaScript programs for all files. -js_files += $(wildcard test/js/*.mc) -# js_web_files += $(wildcard test/js/web/*.mc) # Disabled until web FFI is implemented - - -# Programs that we currently cannot typecheck. These are programs written -# before the typechecker was implemented. It is forbidden to add to this list of -# programs but removing from it is very welcome. -typecheck_files_exclude += stdlib/parser/breakable-helper.mc -typecheck_files_exclude += test/mexpr/nestedpatterns.mc -typecheck_files_exclude += test/mlang/nestedpatterns.mc -typecheck_files_exclude += test/mlang/mlang.mc -typecheck_files_exclude += test/mlang/catchall.mc - - -# Programs that we currently cannot compile/test. These are programs written -# before the compiler was implemented. It is forbidden to add to this list of -# programs but removing from it is very welcome. -compile_files_exclude += stdlib/parser-combinators.mc -compile_files_exclude += stdlib/regex.mc -compile_files_exclude += test/mexpr/nestedpatterns.mc -compile_files_exclude += test/mlang/also_includes_lib.mc -compile_files_exclude += test/mlang/mlang.mc -compile_files_exclude += test/mlang/nestedpatterns.mc -compile_files_exclude += test/mlang/catchall.mc - - -# Programs that we currently cannot interpret/test. These are programs written -# before the compiler was implemented. It is forbidden to add to this list of -# programs but removing from it is very welcome. -run_files_exclude += stdlib/regex.mc -run_files_exclude += stdlib/parser-combinators.mc -run_files_exclude += test/mlang/catchall.mc -run_files_exclude += test/mlang/mlang.mc - -# Programs that we should be able to compile/test if we prune utests. -compile_files_prune =\ - $(filter-out $(python_files) $(compile_files_exclude), $(src_files_all)) - -# Programs that we should be able to compile/test, even without utest pruning, -# if all, except the special, external dependencies are met. -compile_files =\ - $(filter-out $(special_dependencies_files) $(typecheck_files_exclude),\ - $(compile_files_prune)) - - -# Programs the we should be able to interpret/test with the interpreter. -run_files =\ - $(filter-out $(python_files) $(run_files_exclude) $(typecheck_files_exclude),\ - $(src_files_all)) - - -# Programs that we should be able to interpret/test with boot. -boot_files = $(filter-out $(python_files), $(src_files_all)) diff --git a/test-ipopt.mk b/test-ipopt.mk deleted file mode 100644 index 0cce979fa..000000000 --- a/test-ipopt.mk +++ /dev/null @@ -1,8 +0,0 @@ -include test-files.mk - -.PHONY: all $(ipopt_files) - -all: $(ipopt_files) - -$(ipopt_files): - @./make.sh compile-test $@ "build/mi compile --test --disable-optimizations --disable-prune-utests" diff --git a/test-js.mk b/test-js.mk deleted file mode 100644 index 2d209beca..000000000 --- a/test-js.mk +++ /dev/null @@ -1,11 +0,0 @@ -include test-files.mk - -.PHONY: test-js $(js_files) $(js_web_files) - -test-js: $(js_files) $(js_web_files) - -$(js_files): - @./make.sh run-js-test $@ - -$(js_web_files): - @./make.sh run-js-web-test $@ diff --git a/test-jvm.mk b/test-jvm.mk deleted file mode 100644 index aa8bfa0e6..000000000 --- a/test-jvm.mk +++ /dev/null @@ -1,8 +0,0 @@ -include test-files.mk - -.PHONY: all $(jvm_files) - -all: $(jvm_files) - -$(jvm_files): - @./make.sh compile-test $@ "build/mi compile --test --disable-optimizations --disable-prune-utests" diff --git a/test-par.mk b/test-par.mk deleted file mode 100644 index bbca73503..000000000 --- a/test-par.mk +++ /dev/null @@ -1,10 +0,0 @@ - -compile_files += stdlib/multicore/atomic.mc -compile_files += stdlib/multicore/thread.mc - -.PHONY: all $(compile_files) - -all: $(compile_files) - -$(compile_files): - @./make.sh compile-test $@ "build/mi compile --test --disable-optimizations" diff --git a/test-run.mk b/test-run.mk deleted file mode 100644 index 65996397b..000000000 --- a/test-run.mk +++ /dev/null @@ -1,10 +0,0 @@ -include test-files.mk - -.PHONY: all selected $(src_files_all) - -all: $(src_files_all) - -selected: $(run_files) - -$(src_files_all): - @./make.sh run-test $@ diff --git a/test-sundials.mk b/test-sundials.mk deleted file mode 100644 index 08b0492f0..000000000 --- a/test-sundials.mk +++ /dev/null @@ -1,8 +0,0 @@ -include test-files.mk - -.PHONY: all $(sundials_files) - -all: $(sundials_files) - -$(sundials_files): - @./make.sh compile-test $@ "build/mi compile --test --disable-optimizations --disable-prune-utests" diff --git a/test-tune.mk b/test-tune.mk deleted file mode 100644 index da14af064..000000000 --- a/test-tune.mk +++ /dev/null @@ -1,10 +0,0 @@ - -tune_files += test/examples/tuning/tune-sleep.mc -tune_files += test/examples/tuning/tune-context.mc - -.PHONY: all $(tune_files) - -all: $(tune_files) - -$(tune_files): - @./make.sh compile-test $@ "build/mi tune --test --disable-optimizations --compile --disable-exit-early --enable-cleanup" diff --git a/tup.config b/tup.config deleted file mode 100644 index f2b8a8b71..000000000 --- a/tup.config +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_USE_INSTALLED_MI=n -CONFIG_USE_BUILT_MI=n -CONFIG_USE_CHEATED_MI=y