1. CI/CD for Exercism

I'm currently working on the CI/CD stuff for the Exercism track. I'm in the part where we parse the test results to check for success/all-fail/part-fail/syntax-error/empty-file.

Regarding the syntax error

/tmp/leap.ex:1 
<0076>:: expected to see an assignment after 'publ1367A', such as =, +=, -=, *=, /= or &= 
publ1367A&#^&*^#b134 
Are the error numbers defined somewhere or should I parse the number out from between the < and >:: and then use some internal function to get its actual value?

-Bruce

MORE DETAIL

Each language offered by Exercism has a test-runner and Euphoria's is here. There are things tested for:

  • All tests fail
  • Some tests fail
  • All tests succeed
  • There's nothing to test
  • Syntax error

The way I've got eutest set up there's no way of telling the difference between some tests failing and all tests failing. I've asked whether that's important. If it is I'll be back here asking for help with eutest. I'm already expecting to have to change my tests slightly so that I can tell if there's nothing to test. The first part of the message is how to handle the syntax error situation.

Regarding the "nothing to test" scenario, include seems to fail quietly. Is there a way to make include fail loudly?

Here's an example test, in this case testing the leap exercise:

include std/unittest.e  
 
include leap.ex  
 
set_test_verbosity(TEST_SHOW_ALL) 
 
test_false("year not divisible by 4 in common year"  , leap(1800)) 
test_false("year divisible by 100 but not by 3 is still not a leap year"  , leap(1900)) 
test_false("year divisible by 2, not divisible by 4 in common year"  , leap(1970)) 
test_false("year divisible by 200, not divisible by 400 in common year"  , leap(2015)) 
test_false("year divisible by 100, not divisible by 400 in common year"  , leap(2100)) 
test_true("year divisible by 4 and 5 is still a leap year"  , leap(1960)) 
test_true("year divisible by 4, not divisible by 100 in leap year"  , leap(1996)) 
test_true("year divisible by 400 is leap year"  , leap(2000)) 
test_true("year divisible by 400 but not by 125 is still a leap year"  , leap(2400)) 
  
test_report()  
 

Correct me if I'm wrong here, but I expect that the includes will get processed before the code is evaluated, so putting a test for file existence in above the include leap.ex will get evaluated after the file has been or not been included.

LATER

Okay, maybe I check that the routine to be tested is defined. Use routine_id and test eutest to fail (somehow) if it's -1

EVEN LATER

Ah ... my bad. There is a better response to a missing function, viz

<0074>:: Errors resolving the following references: 

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu