Skip to content

Commit 49528dd

Browse files
nucularmood471061c
authored andcommitted
Added point tracking for every test case
Added point tracking for test cases. Also configured test case project files to link libraries correctly when building on Windows.
1 parent ef1371c commit 49528dd

File tree

24 files changed

+144
-24
lines changed

24 files changed

+144
-24
lines changed

tmc-langs-qmake/src/test/resources/failing_compile_single_lib_compiling/failing_compile_single_lib_compiling.pro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#This additional CONFIG variable option will allow libraries
2+
#to be correctly linked when building projects using Windows.
3+
4+
win32 {
5+
CONFIG -= debug_and_release debug_and_release_target
6+
}
7+
18
TEMPLATE = subdirs
29
SUBDIRS += \
310
test_case_app \

tmc-langs-qmake/src/test/resources/failing_compile_single_lib_compiling/test_case_test_runner/test_case_test_runner.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#include "test_case_test_runner.h"
33
#include "test_case_lib.h"
44

5+
// Produces qInfo("TMC:test_name.point")
6+
#define POINT(test_name, point) qInfo("TMC:"#test_name"."#point)
7+
58
test_case_test_runner::test_case_test_runner(QObject *parent) : QObject(parent)
69
{
710

@@ -11,7 +14,7 @@ void test_case_test_runner::test_function_one_here() {
1114

1215
test_case_lib test_case;
1316

14-
qInfo("TMC:test_function_one_here.1");
17+
POINT(test_function_one_here, 1);
1518
QVERIFY(!strcmp(test_case.piece_of_string(), "Hello, world!"));
1619

1720
}
@@ -20,7 +23,7 @@ void test_case_test_runner::test_function_two_here() {
2023

2124
test_case_lib test_case;
2225

23-
qInfo("TMC:test_function_two_here.2");
26+
POINT(test_function_two_here, 2);
2427
QVERIFY(test_case.adding_ints(666, 1337) == 2003);
2528

2629
}

tmc-langs-qmake/src/test/resources/failing_nolib/failing_nolib.pro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#This additional CONFIG variable option will allow libraries
2+
#to be correctly linked when building projects using Windows.
3+
4+
win32 {
5+
CONFIG -= debug_and_release debug_and_release_target
6+
}
7+
18
TEMPLATE = subdirs
29
SUBDIRS += \
310
test_case_app \

tmc-langs-qmake/src/test/resources/failing_nolib/test_case_test_runner/test_case_test_runner.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#include "test_case_test_runner.h"
33
#include "test_case_app.h"
44

5+
// Produces qInfo("TMC:test_name.point")
6+
#define POINT(test_name, point) qInfo("TMC:"#test_name"."#point)
7+
58
test_case_test_runner::test_case_test_runner(QObject *parent) : QObject(parent)
69
{
710

@@ -11,7 +14,7 @@ void test_case_test_runner::test_function_one_here() {
1114

1215
test_case_app test_case;
1316

14-
qInfo("TMC:test_function_one_here.1");
17+
POINT(test_function_one_here, 1);
1518
QVERIFY(!strcmp(test_case.piece_of_string(), "Hello, world!"));
1619

1720
}
@@ -20,7 +23,7 @@ void test_case_test_runner::test_function_two_here() {
2023

2124
test_case_app test_case;
2225

23-
qInfo("TMC:test_function_two_here.2");
26+
POINT(test_function_two_here, 2);
2427
QVERIFY(test_case.adding_ints(666, 1337) == 2003);
2528

2629
}

tmc-langs-qmake/src/test/resources/failing_nolib_same_point/failing_nolib_same_point.pro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#This additional CONFIG variable option will allow libraries
2+
#to be correctly linked when building projects using Windows.
3+
4+
win32 {
5+
CONFIG -= debug_and_release debug_and_release_target
6+
}
7+
18
TEMPLATE = subdirs
29
SUBDIRS += \
310
test_case_app \

tmc-langs-qmake/src/test/resources/failing_nolib_same_point/test_case_test_runner/test_case_test_runner.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#include "test_case_test_runner.h"
33
#include "test_case_app.h"
44

5+
// Produces qInfo("TMC:test_name.point")
6+
#define POINT(test_name, point) qInfo("TMC:"#test_name"."#point)
7+
58
test_case_test_runner::test_case_test_runner(QObject *parent) : QObject(parent)
69
{
710

@@ -11,7 +14,7 @@ void test_case_test_runner::test_function_one_here() {
1114

1215
test_case_app test_case;
1316

14-
qInfo("TMC:test_function_one_here.1");
17+
POINT(test_function_one_here, 1);
1518
QVERIFY(!strcmp(test_case.piece_of_string(), "Hello, world!"));
1619

1720
}
@@ -23,7 +26,7 @@ void test_case_test_runner::test_function_two_here() {
2326
//Please take note that this test will fail because addition in the tested
2427
//function is replaced with multiplication and 0+0=0 as well as 0*0=0
2528

26-
qInfo("TMC:test_function_two_here.2");
29+
POINT(test_function_two_here, 1);
2730
QVERIFY(test_case.adding_ints(0, 0) == 0);
2831

2932
}
@@ -32,6 +35,6 @@ void test_case_test_runner::test_function_two_here_2() {
3235

3336
test_case_app test_case;
3437

35-
qInfo("TMC:test_function_two_here_2.1");
38+
POINT(test_function_two_here_2, 2);
3639
QVERIFY(test_case.adding_ints(-341, 428) == 87);
3740
}

tmc-langs-qmake/src/test/resources/failing_single_lib/failing_single_lib.pro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#This additional CONFIG variable option will allow libraries
2+
#to be correctly linked when building projects using Windows.
3+
4+
win32 {
5+
CONFIG -= debug_and_release debug_and_release_target
6+
}
7+
18
TEMPLATE = subdirs
29
SUBDIRS += \
310
test_case_app \

tmc-langs-qmake/src/test/resources/failing_single_lib/test_case_test_runner/test_case_test_runner.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#include "test_case_test_runner.h"
33
#include "test_case_lib.h"
44

5+
// Produces qInfo("TMC:test_name.point")
6+
#define POINT(test_name, point) qInfo("TMC:"#test_name"."#point)
7+
58
test_case_test_runner::test_case_test_runner(QObject *parent) : QObject(parent)
69
{
710

@@ -11,7 +14,7 @@ void test_case_test_runner::test_function_one_here() {
1114

1215
test_case_lib test_case;
1316

14-
qInfo("TMC:test_function_one_here.1");
17+
POINT(test_function_one_here, 1);
1518
QVERIFY(!strcmp(test_case.piece_of_string(), "Hello, world!"));
1619

1720
}
@@ -20,7 +23,7 @@ void test_case_test_runner::test_function_two_here() {
2023

2124
test_case_lib test_case;
2225

23-
qInfo("TMC:test_function_two_here.2");
26+
POINT(test_function_two_here, 2);
2427
QVERIFY(test_case.adding_ints(666, 1337) == 2003);
2528

2629
}

tmc-langs-qmake/src/test/resources/failing_single_lib_not_compiling/failing_single_lib_not_compiling.pro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#This additional CONFIG variable option will allow libraries
2+
#to be correctly linked when building projects using Windows.
3+
4+
win32 {
5+
CONFIG -= debug_and_release debug_and_release_target
6+
}
7+
18
TEMPLATE = subdirs
29
SUBDIRS += \
310
test_case_app \

tmc-langs-qmake/src/test/resources/failing_single_lib_not_compiling/test_case_test_runner/test_case_test_runner.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#include "test_case_test_runner.h"
33
#include "test_case_lib.h"
44

5+
// Produces qInfo("TMC:test_name.point")
6+
#define POINT(test_name, point) qInfo("TMC:"#test_name"."#point)
7+
58
test_case_test_runner::test_case_test_runner(QObject *parent) : QObject(parent)
69
{
710

@@ -11,7 +14,7 @@ void test_case_test_runner::test_function_one_here() {
1114

1215
test_case_lib test_case;
1316

14-
qInfo("TMC:test_function_one_here.1");
17+
POINT(test_function_one_here, 1);
1518
QVERIFY(!strcmp(test_case.piece_of_string(), "Hello, world!"));
1619

1720
}
@@ -20,7 +23,7 @@ void test_case_test_runner::test_function_two_here() {
2023

2124
test_case_lib test_case;
2225

23-
qInfo("TMC:test_function_two_here.2");
26+
POINT(test_function_two_here, 2);
2427
QVERIFY(test_case.adding_ints(666, 1337) == 2003);
2528

2629
}

0 commit comments

Comments
 (0)