ng-qt / ng-test

Test library for NodeGUI based on QTest
https://doc.qt.io/qt-5/qtest.html
MIT License
3 stars 1 forks source link

Using this library in my own project #26

Open cancerberoSgx opened 5 years ago

cancerberoSgx commented 5 years ago

I'm trying to use this library in my own project but I fail. BTW I'm trying to use it in nodegui to write tests for it

I tried something like this

docker run --rm -i -v "$PWD":/code --workdir /code ngqt/qode sh test.sh

where test.sh is

rm -rf node_modules package-lock.json yarn.lock build .vscode dist
uname -a 
npm -v
node -v
yarn -v
apt-get install clang-tidy
yarn install --verbose

and ./package.json has "@ng-qt/ng-test": "0.0.3",

but fails with error (see below)

same for

rm -rf node_modules package-lock.json
docker run --rm -i -v "$PWD":/code --workdir /code ngqt/qode yarn add "@ng-qt/ng-test"

or with npm

 rm -rf node_modules/ && docker run --rm -i -v "$PWD":/code --workdir /code ngqt/qode npm i -D "@ng-qt/ng-test"

Also tried the same on a linux host with required dependencies and on macOs (in which will fail because Qtwidgets.so is not found..

Error:

Configuring done
-- Generating done
-- Build files have been written to: /code/node_modules/@ng-qt/ng-test/build
info CMD BUILD
info RUN cmake --build "/code/node_modules/@ng-qt/ng-test/build" --config Release
Scanning dependencies of target NgTest
[ 16%] Building CXX object CMakeFiles/NgTest.dir/src/main.cpp.o
Error running 'clang-tidy': No such file or directory
CMakeFiles/NgTest.dir/build.make:62: recipe for target 'CMakeFiles/NgTest.dir/src/main.cpp.o' failed
make[2]: *** [CMakeFiles/NgTest.dir/src/main.cpp.o] Error 1
CMakeFiles/Makefile2:75: recipe for target 'CMakeFiles/NgTest.dir/all' failed
make[1]: *** [CMakeFiles/NgTest.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
ERR! OMG Process terminated: 2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
/bin/sh: 1: endif: not found
    at ProcessTermError.ExtendableBuiltin (/opt/yarn-v1.17.3/lib/cli.js:721:66)
    at ProcessTermError.MessageError (/opt/yarn-v1.17.3/lib/cli.js:750:123)
    at new ProcessTermError (/opt/yarn-v1.17.3/lib/cli.js:790:113)
    at ChildProcess.<anonymous> (/opt/yarn-v1.17.3/lib/cli.js:25874:17)
    at ChildProcess.emit (events.js:209:13)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
marcus-sa commented 5 years ago

Sometimes I forget bash isn't supported on Windows, so the package scripts would have to be refactored for cross platform installations.

It seems weird that bash can't find endif

I'll look into this.

cancerberoSgx commented 5 years ago

@marcus-sa just a heads up about a previous error that might be causing this: [ 16%] Building CXX object CMakeFiles/NgTest.dir/src/main.cpp.o Error running 'clang-tidy': No such file or directory

How do you run docker ? we should add a working command example in the readme

marcus-sa commented 5 years ago

@cancerberoSgx yes you're right. I'll update the documentation tomorrow and get this bug fixed.