Skip to content

Comments

Extend documentation mode to document tests#756

Merged
cxxxr merged 14 commits intolem-project:mainfrom
Sasanidas:main
Jun 22, 2023
Merged

Extend documentation mode to document tests#756
cxxxr merged 14 commits intolem-project:mainfrom
Sasanidas:main

Conversation

@Sasanidas
Copy link
Member

The idea is to generate a markdown file with a table of each tests, this is intended to use not only with SBCL but with more implementations.

@Sasanidas
Copy link
Member Author

The CI error seems a little bit odd, maybe roswell is using a different rove version from quicklisp?

;   READ error during COMPILE-FILE:
;   
;     Symbol "TEST-PASSED-ASSERTIONS" not found in the ROVE package.
;   
;       Line: 51, Column: 33, File-Position: 1529
;   
;       Stream: #<SB-INT:FORM-TRACKING-STREAM for "file /home/runner/work/lem/lem/modes/documentation-mode/documentation-tests.lisp" {100118B893}>
Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread #<SB-THREAD:THREAD tid=3413 "main thread" RUNNING
                                                          {1001288073}>:
  COMPILE-FILE-ERROR while
  compiling #<CL-SOURCE-FILE "lem-documentation-mode" "documentation-tests">

@Sasanidas Sasanidas mentioned this pull request Jun 18, 2023
16 tasks
@Sasanidas
Copy link
Member Author

Sasanidas commented Jun 19, 2023

Any idea on how to solve this CI issue? Maybe don't include rove as dependency? (ping @cxxxr)

@cxxxr
Copy link
Member

cxxxr commented Jun 19, 2023

I do not currently understand the fundamental cause, but it does seem like something is wrong if the production code is dependent on the test framework.

@Sasanidas
Copy link
Member Author

I do not currently understand the fundamental cause, but it does seem like something is wrong if the production code is dependent on the test framework.

Indeed, I moved the file to scritps/ and added an entry to the Makefile, the idea of the append version is that it can be generated with different implementations easily 👍

@cxxxr
Copy link
Member

cxxxr commented Jun 20, 2023

fukamachi/rove@82be18b
Isn't the symbol test-passed-assertions lost in this commit?

@cxxxr
Copy link
Member

cxxxr commented Jun 20, 2023

I think this feature is very great.

@Sasanidas
Copy link
Member Author

I changed the rove calls for the new version on quicklisp and it seems to work correctly 👍

Copy link
Member

@cxxxr cxxxr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a few comments, but overall I think it is very good.

Minor comments: Indentation includes tabs, but I prefer to use all spaces.
Is it because it is the default setting in emacs?

(insert-character point #\newline)))))

(defun generate-markdown-file (filename)
(defgeneric generate-markdown-file (filename type))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method dispatch is very attractive and I love it.
But here I felt it would be better to simply separate the functions
What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ummm, I was thinking to use this functionality to generate other kind of markdown, like with maybe benchmark, so I think it can be reused.

But I tend to overuse generics, so if you like I can change it back to a function 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was only thinking about statically determining which method the caller is.
I thought a function would be better in that case.
However, if we need extensibility in the future, it may be better to make it a method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, if we need extensibility in the future, it may be better to make it a method.

Ummm, I do think it may be extensible in the future indeed, in any case I'll change it if you want 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this might be fine as it is too.

(enough-namestring (location-file location) (asdf:system-source-directory :lem))
(location-line-number location))))

#+sbcl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since separation by *features* is complicated, I think it is preferable to keep it to a minimum.
except sbcl, what about command-definition-location returning meaningless values (e.g., always set position to 0)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean something like this 52a90eb?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I thought it would be better to consolidate on the called side rather than the caller.
How about setting the file name to nil to indicate that it has no meaning?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

@cxxxr cxxxr merged commit 1568d91 into lem-project:main Jun 22, 2023
@cxxxr
Copy link
Member

cxxxr commented Jun 22, 2023

Thank you so much!

@cxxxr cxxxr mentioned this pull request Jul 11, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants