1
1
mirror of https://github.com/idris-lang/Idris2.git synced 2024-12-23 03:32:09 +03:00
Idris2/tests
vfrinken b1f45f2748
RefC backend improvements ()
* RefC backend improvements

1. OnCollect had the wrong number of arguments. The code creator expects
   3 arguments, but onCollect in prim.h expected 4 arguments. The first of which
   was an erased arguments. That is now fixed.

2. OnCollect did not call `newReference` when creating a new reference to the pointer
   and the freeing function

3. OnCollect and OnCollectAny still had a spurious printf statement

Those issues have been fixed, the test case can be found in
  tests/refc/garbageCollect

4. The IORef mechanism expects that the %World token will be passed around
   consistently. This is not the case. States in Control.App make use of
   IORefs, but the function created from Control.App.prim_app_bind
   had the world token erased to NULL.
   Now, IORefs are managed using a global variable,
   IORef_Storage * global_IORef_Storage;
   referenced in cBackend.h, defined in the created .c file, and set to NULL
   in main();

5. While multithreading and forking is still not supported, compiling a program
   that makes use of Control.App demands a C implementation of prim_fork.
   Files support/refc/threads.c and support/refc/threads.h provide a
   dummy implementation for it, so that Control.App programs compile and run.

A test for these 2 issues is given in tests/refc/issue2424

* format changes

to make the linter happy

* format changes

to make the linter happy

* format changes

to make the linter happy

* spelling mistake braket -> bracket

Co-authored-by: Volkmar Frinken <volkmar@onutechnology.com>
2022-04-27 13:59:32 +01:00
..
allbackends Move rm -rf to the beginning of the test 2021-07-13 22:54:53 +01:00
base System NodeJS additions () 2022-04-07 10:09:30 +01:00
chez [ base ] Add some more properties, functions and interface implementations () 2022-03-23 13:33:13 +00:00
codegen [ fix ] rewrite_impl is linear () 2021-11-25 17:07:05 +00:00
contrib Add Alternating List odds and evens functions 2021-11-10 08:40:25 +00:00
gambit/bitops001 Add Data.Bits to base () 2021-03-04 20:59:56 +00:00
ideMode [ refactor ] Index Pretty over the type of annotations () 2022-04-27 12:26:59 +01:00
idris2 [ refactor ] Index Pretty over the type of annotations () 2022-04-27 12:26:59 +01:00
node Fix prim__div_Double on Node/js backend 2022-03-26 19:00:46 +00:00
prelude adopt backend implementations of pow () 2022-03-03 23:39:25 +00:00
racket Patch CVs and sleep in Racket () 2021-03-15 13:43:12 +00:00
refc RefC backend improvements () 2022-04-27 13:59:32 +01:00
templates Move rm -rf to the beginning of the test 2021-07-13 22:54:53 +01:00
ttimp Cumulativity preparation: Add field for universe level to TType () 2021-10-31 00:00:16 +01:00
typedd-book [ refactor ] Abstract Prelude.elem to work with all Foldables () 2022-02-01 21:34:29 +00:00
vmcode/basic001 Move rm -rf to the beginning of the test 2021-07-13 22:54:53 +01:00
Main.idr Revert "[ fix ] search should solve auto implicits before implicits" 2022-04-27 11:00:51 +01:00
Makefile [ cleanup ] Test.Golden () 2021-06-21 17:30:11 +01:00
README.md Test templates () 2020-11-27 15:40:02 +00:00
tests.ipkg Set PREFIX for tests 2021-04-19 11:23:58 +01:00

Tests

Note: The commands listed in this section should be run from the repository's root folder.

Run all tests: make test

To run only a subset of the tests use: make test only=NAME. NAME is matched against the path to each test case.

Examples:

  • make test only=chez will run all Chez Scheme tests.
  • make test only=ttimp/basic will run all basic tests for TTImp.
  • make test only=idris2/basic001 will run a specific test.

Templates for common test instances can be found in the templates folder.