zig icon indicating copy to clipboard operation
zig copied to clipboard

ci: consider adding to matrix: x86_64 backend

Open ee7 opened this issue 1 year ago • 0 comments

This would be a check that is allowed to fail, and should probably be required before we make the test runner use the x86_64 backend (see https://github.com/exercism/zig-test-runner/pull/72).

The testing command is defined here:

https://github.com/exercism/zig/blob/3ed283775d64df64deaf3793c4c628a297fe8f2d/bin/run-tests#L17

if we make the following edit:

-      zig test "test_${exercise_name}.zig" 
+      zig test -fno-llvm -fno-lld "test_${exercise_name}.zig"

then run bin/run-tests, we get plenty of errors with Zig 0.11.0:

$ zig version
0.11.0
$ git rev-parse --short HEAD
3ed2837
$ bin/run-tests
Running tests for acronym...
All 9 tests passed.

Running tests for allergies...
Test [41/50] test.initAllergenSet: no allergies... expected 0, found 4
Test [41/50] test.initAllergenSet: no allergies... FAIL (TestExpectedEqual)
Test [42/50] test.initAllergenSet: just eggs... expected 1, found 5
Test [42/50] test.initAllergenSet: just eggs... FAIL (TestExpectedEqual)
Test [43/50] test.initAllergenSet: just peanuts... expected 1, found 5
Test [43/50] test.initAllergenSet: just peanuts... FAIL (TestExpectedEqual)
Test [44/50] test.initAllergenSet: just strawberries... expected 1, found 5
Test [44/50] test.initAllergenSet: just strawberries... FAIL (TestExpectedEqual)
Test [45/50] test.initAllergenSet: eggs and peanuts... expected 2, found 6
Test [45/50] test.initAllergenSet: eggs and peanuts... FAIL (TestExpectedEqual)
Test [46/50] test.initAllergenSet: more than eggs but not peanuts... expected 2, found 6
Test [46/50] test.initAllergenSet: more than eggs but not peanuts... FAIL (TestExpectedEqual)
Test [47/50] test.initAllergenSet: lots of stuff... expected 5, found 9
Test [47/50] test.initAllergenSet: lots of stuff... FAIL (TestExpectedEqual)
Test [48/50] test.initAllergenSet: everything... expected 8, found 12
Test [48/50] test.initAllergenSet: everything... FAIL (TestExpectedEqual)
Test [49/50] test.initAllergenSet: no allergen score parts... expected 7, found 11
Test [49/50] test.initAllergenSet: no allergen score parts... FAIL (TestExpectedEqual)
Test [50/50] test.initAllergenSet: no allergen score parts without highest valid score... expected 1, found 5
Test [50/50] test.initAllergenSet: no allergen score parts without highest valid score... FAIL (TestExpectedEqual)
40 passed; 0 skipped; 10 failed.
error: the following test command failed with exit code 1:
/home/foo/.cache/zig/o/3240f7ed7d874551936c5b5c772d0964/test

Running tests for all-your-base...
All 18 tests passed.

Running tests for anagram...
All 16 tests passed.

Running tests for armstrong-numbers...
armstrong_numbers.zig:4:5: error: TODO implement genMulDivBinOp from u128 to u128
pub fn isArmstrongNumber(num: u128) bool {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/math/log10.zig:41:5: error: TODO implement genMulDivBinOp from u128 to u128
pub fn log10_int(x: anytype) Log2Int(@TypeOf(x)) {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/math/powi.zig:26:5: error: TODO implement genMulDivBinOp from u128 to u128
pub fn powi(comptime T: type, x: T, y: T) (error{
~~~~^~

Running tests for atbash-cipher...
All 14 tests passed.

Running tests for binary-search...
All 11 tests passed.

Running tests for bob...
All 25 tests passed.

Running tests for collatz-conjecture...
All 5 tests passed.

Running tests for darts...
All 13 tests passed.

Running tests for difference-of-squares...
All 9 tests passed.

Running tests for dnd-character...
AST Lowering [534] Build/Cache/DepTokenizer.zig... error(x86_64_encoder): no encoding found for: none cmovz cl r8 none none
dnd_character.zig:18:5: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
pub fn modifier(score: u8) i8 {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

Running tests for grains...
All 10 tests passed.

Running tests for hamming...
All 9 tests passed.

Running tests for hello-world...
All 1 tests passed.

Running tests for isbn-verifier...
All 19 tests passed.

Running tests for isogram...
All 14 tests passed.

Running tests for leap...
All 9 tests passed.

Running tests for linked-list...
All 19 tests passed.

Running tests for luhn...
All 22 tests passed.

Running tests for matching-brackets...
All 21 tests passed.

Running tests for nucleotide-count...
All 5 tests passed.

Running tests for pangram...
All 10 tests passed.

Running tests for perfect-numbers...
All 11 tests passed.

Running tests for proverb...
Test [3/6] test.two pieces... FAIL (OutOfMemory)
[gpa] (err): memory address 0x7f1c8da45000 leaked:

Test [4/6] test.three pieces... FAIL (OutOfMemory)
[gpa] (err): memory address 0x7f1c8da4d000 leaked:

Test [5/6] test.full proverb... FAIL (OutOfMemory)
[gpa] (err): memory address 0x7f1c8da53000 leaked:

Test [6/6] test.four pieces modernized... FAIL (OutOfMemory)
[gpa] (err): memory address 0x7f1c8da58000 leaked:

2 passed; 0 skipped; 4 failed.
4 errors were logged.
4 tests leaked memory.
error: the following test command failed with exit code 1:
/home/foo/.cache/zig/o/153124d3810418e2406f743b498a482a/test

Running tests for queen-attack...
All 14 tests passed.

Running tests for raindrops...
All 18 tests passed.

Running tests for resistor-color...
All 4 tests passed.

Running tests for resistor-color-duo...
All 6 tests passed.

Running tests for reverse-string...
All 6 tests passed.

Running tests for rna-transcription...
All 6 tests passed.

Running tests for scrabble-score...
All 11 tests passed.

Running tests for secret-handshake...
All 11 tests passed.

Running tests for sieve...
All 5 tests passed.

Running tests for space-age...
space_age.zig:11:9: error: TODO implement airFloatFromInt from usize to f64
    pub fn age(self: Planet, seconds: usize) f64 {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/fmt/errol.zig:301:1: error: TODO implement airIntFromFloat from f64 to u128
fn errolInt(val: f64, buffer: []u8) FloatDecimal {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/fmt/errol.zig:360:1: error: TODO implement airIntFromFloat from f64 to u64
fn errolFixed(val: f64, buffer: []u8) FloatDecimal {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Running tests for sum-of-multiples...
All 17 tests passed.

Running tests for triangle...
/usr/lib/zig/std/fmt/errol.zig:301:1: error: TODO implement airIntFromFloat from f64 to u128
fn errolInt(val: f64, buffer: []u8) FloatDecimal {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/fmt/errol.zig:360:1: error: TODO implement airIntFromFloat from f64 to u64
fn errolFixed(val: f64, buffer: []u8) FloatDecimal {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Running tests for two-fer...
All 3 tests passed.

Running tests for word-count...
Test [9/14] test.with apostrophes... ^C

(it hangs)

$ bin/run-tests yacht
Running tests for yacht...
All 29 tests passed.

ee7 avatar Sep 25 '23 11:09 ee7