Skip to content

Commit

Permalink
ci: update build commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenvukhang committed Feb 6, 2023
1 parent 6f3c468 commit 4a8f839
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
# build canvas-sync
- run: make build

- name: Run tests
run: make test
# - name: Run tests
# run: ./build/test/CanvasSyncTest

# package app
- run: |
Expand Down Expand Up @@ -109,9 +109,10 @@ jobs:
-DCMAKE_PREFIX_PATH=${{ env.Qt6_DIR }}
cmake --build build --parallel
- name: Run tests
shell: bash
run: make test
# - name: Run tests
# run: |
# ls build/test
# ./build/test/CanvasSyncTest.exe

- name: Use windeployqt to load libraries
shell: bash
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
enable_testing(TRUE)

find_package(Qt6 REQUIRED COMPONENTS Widgets Network Gui Test)

Expand Down
9 changes: 9 additions & 0 deletions test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,25 @@ void TestGui::fetch_courses_ui_test()
MainWindow *app = create_app();
authenticate(app);

qDebug() << "GONNA TEST THE MODEL";
TreeModel *model = app->ui->treeView->model();
qDebug() << "AFTER GETTING THE MODEL";
QCOMPARE(model->childrenCount(), 3);
qDebug() << "~~~~~~~~~~" << 1;

TreeIndex ptr = model->index(0, 0);
qDebug() << "~~~~~~~~~~" << 2;

QCOMPARE(ptr.course(), "Calculus");
qDebug() << "~~~~~~~~~~" << 3;
ptr = ptr.child(0);
qDebug() << "~~~~~~~~~~" << 4;
QCOMPARE(ptr.remote_dir(), "course files");
qDebug() << "~~~~~~~~~~" << 5;
QCOMPARE(ptr.child(0).remote_dir(), "Admin");
qDebug() << "~~~~~~~~~~" << 6;
QCOMPARE(ptr.child(1).remote_dir(), "Tutorials");
qDebug() << "~~~~~~~~~~" << 7;

ptr = model->index(1, 0);
QCOMPARE(ptr.course(), "Geometry");
Expand Down

0 comments on commit 4a8f839

Please sign in to comment.