areg-sdk icon indicating copy to clipboard operation
areg-sdk copied to clipboard

Feature/122 unit tests for strings

Open harshit496 opened this issue 1 year ago • 8 comments

harshit496 avatar Nov 05 '24 07:11 harshit496

Thank you! Looks much better.

aregtech avatar Nov 09 '24 15:11 aregtech

Can be merged?

harshit496 avatar Nov 09 '24 20:11 harshit496

Could you please make sure that it is compiled under Visual Studio? I tried locally and get errors.

  1. The .cpp file is not included in the areg-unit-tests.vcxproj and areg-unit-tests.vcxproj.filters files;
  2. The MSVC google test adapter does not understand INSTANTIATE_TEST_SUITE_P macro. In other files I use
    #if defined(INSTANTIATE_TEST_SUITE_P)
    INSTANTIATE_TEST_SUITE_P()
    #else   // !defined(INSTANTIATE_TEST_SUITE_P)
    INSTANTIATE_TEST_CASE_P()
    #endif  // defined(INSTANTIATE_TEST_SUITE_P)
    
    An example see in file NEStringTest.cpp

The builds in this PR passed, because new StringTest.cpp file is not included in MSVC build. As soon as you include, the MSBuild will fail. @harshit496 , can you please fix the issue?

aregtech avatar Nov 09 '24 21:11 aregtech

Ah okay. I will take a look. Thanks for pointing out

harshit496 avatar Nov 09 '24 21:11 harshit496

@aregtech I forgot to mention that I am using Linux and I was able to build it fine with cmake although it wont be able to build using msbuild right since that is windows specific?

harshit496 avatar Nov 12 '24 05:11 harshit496

@harshit496, there is GitHub action workflow to run MSBuild. If you include the file in the MSVS project, it will fail. Another solution is, if you merge changes not with main, but with other branch, then I can work on that and fix. Let me know if you need a branch.

aregtech avatar Nov 12 '24 09:11 aregtech

@aregtech I added it to MS build project. where can I find the github action workflow link to see it fail? because currently under the checks tabs on this PR it does not run any jobs. i dont know why

harshit496 avatar Nov 16 '24 02:11 harshit496

Hi @harshit496 ,

This the workflow. Your fork should also have it. As soon as you merge with your master branch, it will be triggered.

Alternatively, you can edit the beginning of msbuild.yml to compile on every push and pull request on any branch:

name: MSBuild

on:
  push:         # Keep empty to run on each branch when push the code. Otherwise, use branches: [ master ]
    # branches: [ master ]
  pull_request:
    # branches: [ master ]

Then you can test locally.

aregtech avatar Nov 16 '24 09:11 aregtech

closing because it is already one year that there is no activity. there are already some string unit tests and they can be extended

aregtech avatar Nov 23 '25 00:11 aregtech