Skip to content
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

Check CPU at runtime #15

Closed
wants to merge 1 commit into from
Closed

Check CPU at runtime #15

wants to merge 1 commit into from

Conversation

polluks
Copy link
Collaborator

@polluks polluks commented Sep 26, 2018

You cannot ask the preprocessor.

You cannot ask the preprocessor.
@sodero
Copy link
Owner

sodero commented Sep 27, 2018

That won't work I'm afraid. AMIGA is set on AROS and MorphOS as well and if I interpret your code correctly that would lead to all identifying as '68000'. Is there some way of probing the CPU in runtime on the AmigaOS clones?

@polluks
Copy link
Collaborator Author

polluks commented Sep 27, 2018

My code works on MorphOS, I have an (emulated) 68060 :)
Indeed, AROS should (also) use GetCPUInfo().

@sodero
Copy link
Owner

sodero commented Sep 27, 2018

It would be great if we could get real runtime CPU info on all platforms.

@polluks
Copy link
Collaborator Author

polluks commented Sep 30, 2018

I just did a quick macOS 10.5 (gcc 4.2.1) test,
after patching the Makefile

CWRN = -Wno-format-nonliteral -Wno-switch-enum
CWRN += -Wno-format-security -Werror #-Weverything -Wno-vla

I get

11 test(s) failed
2124 test(s) passed

@sodero
Copy link
Owner

sodero commented Sep 30, 2018

That's interesting. On MacOS 10.13 you're "supposed" to get 5 failed tests, those are (foreach) tests that depend on the order in which entries are read from a directory (the correct answer is the Linux answer). If you read the output of these tests you can see that they are correct, it's just a permutation of the expected result:

`; In line 14
(foreach "fed" "p" (debug @each-name @each-type) (debug "!")) ; [rm -Rf fed && mkdir fed && touch fed/a && touch fed/b && mkdir fed/c ; rm -Rf fed]
; Actual result [a 1 ! c 2 ! b 1 ! 1]
; Expected result [b 1 ! a 1 ! c 2 ! 1]

; In line 4
(foreach "fed" "p" (debug ("%s/%s" "fed" @each-name))) ; [rm -Rf fed && mkdir fed && touch fed/a && touch fed/b && mkdir fed/c ; rm -Rf fed]
; Actual result [fed/a fed/c fed/b 1]
; Expected result [fed/b fed/a fed/c 1]

; In line 13
(foreach "fed" "p" ((debug @each-name @each-type) (debug "!"))) ; [rm -Rf fed && mkdir fed && touch fed/a && touch fed/b && mkdir fed/c ; rm -Rf fed]
; Actual result [a 1 ! c 2 ! b 1 ! 1]
; Expected result [b 1 ! a 1 ! c 2 ! 1]

; In line 3
(foreach "fed" "p" (debug @each-name @each-type)) ; [rm -Rf fed && mkdir fed && touch fed/a && touch fed/b && mkdir fed/c ; rm -Rf fed]
; Actual result [a 1 c 2 b 1 1]
; Expected result [b 1 a 1 c 2 1]

; In line 15
(foreach "fed" "p" (debug @each-name @each-type) (debug "!") (debug "!!")) ; [rm -Rf fed && mkdir fed && touch fed/a && touch fed/b && mkdir fed/c ; rm -Rf fed]
; Actual result [a 1 ! !! c 2 ! !! b 1 ! !! 1]
; Expected result [b 1 ! !! a 1 ! !! c 2 ! !! 1]`

Which tests fail on 10.5?

@polluks
Copy link
Collaborator Author

polluks commented Sep 30, 2018

FAIL -> (copyfiles (fonts) (all) (source "cfs") (dest "cfd"))
FAIL -> (copyfiles (fonts) (pattern "1.#?") (source "cfs") (dest "cfd"))
FAIL -> (database "cpu")
FAIL -> (database "cpu" "x86_64")
FAIL -> (foreach "fed" "p" (debug @each-name @each-type))
FAIL -> (foreach "fed" "p" (debug ("%s/%s" "fed" @each-name)))
FAIL -> (foreach "fed" "p" ((debug @each-name @each-type) (debug "!")))
FAIL -> (foreach "fed" "p" (debug @each-name @each-type) (debug "!"))
FAIL -> (foreach "fed" "p" (debug @each-name @each-type) (debug "!") (debug "!!"))

FAIL -> (getenv "EDITOR")
FAIL -> (select 1 "abc" (database "cpu") "def")

@sodero
Copy link
Owner

sodero commented Oct 1, 2018

The (database) tests (this includes the last line as well) aren't good, they assume that you're using a x86_64 build which isn't true in your case I guess since you're running 10.5. The (getenv) test is also silly, it assumes that your EDITOR is set to 'vi'. I should really fix these, but they are nothing to worry about.

The (copyfiles) tests definitely shouldn't fail though.

Do you get something like this:

In line 1 FAIL/ERR: FAIL -> (copyfiles (choices "_cf1_" "_cf2_") (source "") (dest "_cfd_"))

Or is it just something like this:

FAIL -> (copyfiles (choices "_cf1_" "_cf2_") (source "") (dest "_cfd_"))

@polluks
Copy link
Collaborator Author

polluks commented Oct 1, 2018

Ok. How about using GitHub's Travis CI?

@sodero
Copy link
Owner

sodero commented Oct 1, 2018

That would be really nice. Do you have any Travis experience?

@polluks
Copy link
Collaborator Author

polluks commented Oct 1, 2018

Some progress https://travis-ci.com/polluks/InstallerLG
/home/travis/build/polluks/InstallerLG/build/../src/file.c:3283: warning: the use of 'mktemp' is dangerous, better use 'mkstemp' or 'mkdtemp'

@sodero
Copy link
Owner

sodero commented Oct 3, 2018

That's very good. Running all tests with Valgrind takes quite some time (and a Linux system) so this would definitely be an improvement. From the output of the latest run (the LEAK thing) my guess is that Valgrind is not installed on the build slave?

When is it triggered? All commits on master? Pull requests as well?

@sodero
Copy link
Owner

sodero commented Oct 3, 2018

I stole some of the code in this PR by the way, and did something that I think might work. It's not very elegant, but what the heck.

@sodero sodero closed this in 3233540 Oct 3, 2018
@polluks
Copy link
Collaborator Author

polluks commented Oct 3, 2018

You have to register the project at http://travis-ci.com then you may copy the file .travis.yml from my repo. Maybe this helps https://stackoverflow.com/questions/41329914/specify-valgrind-options-to-r-package-on-travis-ci

@polluks polluks deleted the patch-3 branch October 15, 2018 23:49
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