-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Break up long testsets #247
Conversation
Codecov Report
@@ Coverage Diff @@
## master #247 +/- ##
==========================================
+ Coverage 91.28% 92.06% +0.78%
==========================================
Files 26 26
Lines 1044 1084 +40
==========================================
+ Hits 953 998 +45
+ Misses 91 86 -5
Continue to review full report at Codecov.
|
Thanks! Did you do this by hand or in an automated way? |
I did it by hand. I tried doing it in an automated way, but I failed. |
These files are automatically generated, so the next time they are regenerated all of your work will be lost. That's why this should be done in an automated way. What did you try? |
Didn't know that. This is what I did so far: f = open("libieeep1788_tests_elem.jl")
code_lines = readlines(f)
#println(code_lines[70][1:5])
#println(length(code_lines))
A = Int[]
chunk_begin = 0
chunk_end = 0
for i in 1:length(code_lines)
if length(code_lines[i]) <= 3
nothing
elseif code_lines[i][1:3] == "fac"
chunk_begin = i
#println(chunk_begin)
elseif code_lines[i][1:3] == "end"
chunk_end = i
#println(chunk_end)
end
if chunk_end - chunk_begin > 100
push!(A, chunk_begin)
chunk_end = 0
end
end
println(A) This code looks for the big blocks of code bigger than 100. My idea was to break-up the blocks in smaller ones by inserting Do you have any suggestions? |
That looks like a good start. I suggest you just accumulate the lines in each |
(Of course, 100 should be a variable that can be changed.) |
This is looking nice! I suggest making this into a function which takes in a file name and chunk size as arguments. |
Ok, I will wrap it in a function once is working well. What did you mean by expressions? Can you read an entire file as an expression (or an array of expressions)? |
I meant "regular expression" -- it's a way to specify a pattern to match and to capture the result of matching that pattern: https://en.wikipedia.org/wiki/Regular_expression https://en.wikibooks.org/wiki/Introducing_Julia/Strings_and_characters#Regular_expressions |
thanks! It's just what I was looking for this morning. It will make the code look cleaner. |
Would it be possible to get rid of a bunch of empty lines in |
@lbenet Yes, it was a problem with the delimiter in the instruction |
1 similar comment
1 similar comment
I think the function is finished . I was comparing the |
Thanks, it's looking good! Maybe a better name is something like Could you write a test for this? I suggest using a simple test file like the one here: JuliaLang/julia#15346 The next step would be to make a new file that runs through each of the test files in the directory and splits them with a sensible name, maybe as they are being run. I wonder if it would even be sensible to make this into a separate package, though that can be done later. |
I didn't include my attempts to use regex because they were not working. So far I found the expression to match the title for each block:
But returns I found two solutions:
or
Ok, I will start writing the test for this. |
In the latest versions of Julia, the tests run much faster, so this is probably no longer necessary. |
Break chunks of code that are longer than 100 lines in the file
libieeep1788_tests_elem.jl
.