Commit Graph

79 Commits

Author SHA1 Message Date
Jeroen van Rijn
da0f722aad Move Odin CI test assets over to its own repository. 2022-04-27 15:56:45 +02:00
Jeroen van Rijn
40f0f5ad8d Update CI for math library. 2022-04-26 15:01:09 +02:00
Jeroen van Rijn
5e11ad2e1e Update test paths. 2022-04-26 14:23:23 +02:00
Jeroen van Rijn
a5342a0126 Address edge cases. 2022-04-26 13:14:09 +02:00
Jeroen van Rijn
3d2856db31 Update tests to use new filename generation code. 2022-04-24 14:19:25 +02:00
Jeroen van Rijn
3cab2592c3 Compiler: Add early error for output path being a directory.
- Introduce new `Path` type and an array of build paths on the build context.
- Resolve input and output paths/files early (before parsing).
- Error early if inputs are missing or outputs are directories.
- Plumb new file path generation into linker stage instead of its adhoc method.

TODO:
- Remove more adhoc file path generation in parser and linker stage.
- Make intermediate object file generation use new path system.
- Round out and robustify Path helper functions.
2022-04-24 13:37:26 +02:00
Jeroen van Rijn
e799476f90 [compress/shoco] Add short string compressor. 2022-04-22 16:55:47 +02:00
Jeroen van Rijn
a30b9b17b3 [json/unmarshal] Fix quoted strings. 2022-04-19 20:32:22 +02:00
Jeroen van Rijn
323e7a2d02 Add JSON unmarshal test. 2022-04-19 15:03:09 +02:00
Jeroen van Rijn
df4a0c62ad Delete accidentally added test artefact. 2022-04-18 19:10:53 +02:00
Jeroen van Rijn
44316401c9 Add uleb128 byte-at-a-time decoder. 2022-04-16 02:07:57 +02:00
Jeroen van Rijn
bf712e9355 [QOI] Add support for RGB images (previously loader always output RGBA).
Also add QOI to CI test suite by roundtripping 8-bit RGB(A) through QOI and checking the hashes match.
2022-04-12 19:23:48 +02:00
Jeroen van Rijn
15b440c4f1 [image] Add QOI load/save.
Additionally:
- Firm up PNG loader with some additional checks.
- Add helper functions to `core:image` to expand grayscale to RGB(A), and so on.

TODO: Possibly replace PNG's post-processing steps with calls to the new helper functions.
2022-04-12 18:14:09 +02:00
Jeroen van Rijn
bb9165edd2 Add -help to CI tests. 2022-04-05 20:45:00 +02:00
Jeroen van Rijn
581d53b96b [math/big] Tell Python test runner how many nails we use.
`_DIGIT_NAILS` is defined as 4, meaning that we use 60 out of every 64 bits.
We can use as few as 1 nail, using 63 bits out of every 64, and all tests will still pass.

However, it needs more testing to see if that's a worthwhile change to make.

For the tests to work properly when changing the nails, Python needs to know about it as well.

In addition, compile the big math code with `-o:speed` going forward.
2022-04-01 16:24:27 +02:00
Jeroen van Rijn
df32b5b46c [windows] Fix leak in glob. 2022-03-29 16:13:17 +02:00
Jeroen van Rijn
24c48d22bc [strings] Improve cut, add tests for it. 2022-03-27 22:13:26 +02:00
gitlost
8661457512 Use WIFEXITED() and WEXITSTATUS() on Unix system() exit code
(ensures Odin run returns correct exit code of built executable)
Adds test "tests/core/os/test_core_os_exit.odin" (Unix only)
2022-03-24 19:31:46 +00:00
gingerBill
7203560b06 Fix test 2022-03-24 12:15:03 +00:00
gitlost
374e71e9b0 Fix issue #1537 "filepath.split_list requires a trailing separator"
Does `make()` with `count + 1` and appends final component (note a
  trailing separator will now result in an empty final component)
Adds test "tests/core/path/filepath/test_core_filepath.odin"
2022-03-23 17:44:35 +00:00
gitlost
4f5203e661 Fix some core:encoding/hxa stuff (error handling, header, max -> min)
Also add missing f16 case to core:reflect as_u64 & as_f64
Add tests for above & add previous tests missing from test/core/build.bat
2022-03-16 19:12:00 +00:00
Jeroen van Rijn
ef3f448861 Remove accidentally committed test binary. 2022-03-14 13:06:50 +01:00
gitlost
7dbcaf792d Merge branch 'master' into fract_trunc_classify_#1574
Resolve conflicts with [9848e88] & sameify Makefile & tests/common/common.odin
2022-03-09 16:09:04 +00:00
Jeroen van Rijn
52e60526ef tabs. 2022-03-08 19:32:30 +01:00
Jeroen van Rijn
76b10b5f5d [varint] Add additional LEB128 tests. 2022-03-08 19:28:55 +01:00
gitlost
b94a7a87fa Fix issue #1574 "fract in linalg/glm is broken" by fixing
trunc_f16/32/64 in "math.odin" (~ typos on expressions)
Fix classify_f16 Inf test (would fail for subnormal 0h0001)
  by changing multiplier 0.5 -> 0.25
Add some useful consts to "math.odin" (INF_F16 etc)
Add comment to "demo.odin" mentioning that -0.0 must be used
  to specify negative zero
2022-03-08 18:06:25 +00:00
Jeroen van Rijn
e76a5d8e12 [varint] Add signed LEB128 encoding. 2022-03-08 18:07:16 +01:00
Jeroen van Rijn
6d7217f37a [varint] Add LEB128 decoding + tests
Also make tests in general less spammy: Don't print [PASS] for each successful test, only report failures and progress.
2022-03-08 15:40:00 +01:00
Jeroen van Rijn
6d9f84ba03 [tests] Make test runners exit with errorlevel 1 if a test fails. 2022-03-03 15:16:16 +01:00
zhibog
e7be9493ba Added SipHash + tests and fixed remaining semicolons in vendor/botan 2022-02-22 19:56:07 +01:00
gingerBill
f5697dd7f2 Merge branch 'master' into odin-global-constants-as-enums 2022-02-15 15:47:24 +00:00
NoahR02
accb35506f Ports OpenSimplex2 from https://github.com/KdotJPG/OpenSimplex2 to Odin. Adds tests for the noise procedures. 2022-02-08 06:25:07 -05:00
NoahR02
817bc7434d Ports OpenSimplex2 from https://github.com/KdotJPG/OpenSimplex2 to Odin. Adds tests for the noise procedures. 2022-02-08 06:16:10 -05:00
gingerBill
6223f48c3f Update tests 2022-01-20 20:08:24 +00:00
gingerBill
2a325b3da0 Update ODIN_ENDIAN usage 2022-01-16 12:25:39 +00:00
Jeroen van Rijn
938744b276 [math/big] Rename internal_int_shl_digit to _private_int_shl_leg.
Same for the SHR variant. These are pure implementation details to shift by a leg/word at a time.
Prevent accidental usage.
2021-12-11 15:22:24 +01:00
Jeroen van Rijn
c94098c2ab [math/big] Fix int_set and int_get. 2021-12-09 16:14:04 +01:00
Yawning Angel
6bafa21bee crypto: Add rand_bytes
This adds `rand_bytes(dst: []byte)` which fills the destination buffer
with entropy from the cryptographic random number generator.  This takes
the "simple is best" approach and just directly returns the OS CSPRNG
output instead of doing anything fancy (a la OpenBSD's arc4random).
2021-11-17 14:00:00 +00:00
Yawning Angel
6c4c9aef61 core/crypto: Add chacha20poly1305
This package implements the chacha20poly1305 AEAD construct as specified
in RFC 8439.
2021-11-17 13:59:53 +00:00
Yawning Angel
7bed317636 core/crypto: Add chacha20
This package implements the ChaCha20 stream cipher as specified in
RFC 8439, and the somewhat non-standard XChaCha20 variant that supports
a 192-bit nonce.

While an IETF draft for XChaCha20 standardization exists,
implementations that pre-date the draft use a 64-bit counter, instead of
the IETF-style 32-bit one.  This implementation opts for the latter as
compatibility with libsodium is more important than compatibility with
an expired IETF draft.
2021-11-17 13:59:53 +00:00
Yawning Angel
64db286582 core/crypto: Add poly1305
This package implements the Poly1305 MAC algorithm as specified in RFC
8439, using routines taked from fiat-crypto and poly1305-donna.
2021-11-17 13:59:53 +00:00
Yawning Angel
1a7a6a9116 core/crypto: Add x25519
This package implements the X25519 key agreement scheme as specified in
RFC 7748, using routines taken from fiat-crypto and Monocypher.
2021-11-17 13:59:53 +00:00
zhibog
8aadcacc0b Add tests to Linux and Mac and add vendor tests 2021-11-10 15:22:12 +01:00
zhibog
c24454ae70 Removed context switching system from the crypto library to simplify the code 2021-11-09 16:50:13 +01:00
Daniel Gavin
5b074ceee5 Add json encoding test + fix enum not being set on success. 2021-11-07 14:35:52 +01:00
zhibog
8876328e4d Move botan.dll to correct directory 2021-10-14 23:03:55 +02:00
zhibog
f4ff11a7ff Added botan.dll for tests 2021-10-14 22:58:20 +02:00
zhibog
77be7144c3 Add crypto library. Additional information is included in the README.md 2021-10-14 22:20:55 +02:00
Jeroen van Rijn
c4b4a841d6 png: Move metadata. 2021-10-06 22:43:33 +02:00
Jeroen van Rijn
8fcd1794a6 png: Add sane compile-time maximums for dimensions + chunk sizes. 2021-10-06 21:48:22 +02:00