File tree Expand file tree Collapse file tree 6 files changed +40
-6
lines changed Expand file tree Collapse file tree 6 files changed +40
-6
lines changed Original file line number Diff line number Diff line change
1
+ # Ignore all
2
+ *
3
+
4
+ # Unignore all with extensions
5
+ ! * . *
6
+
7
+ # Unignore all dirs
8
+ ! * /
9
+
1
10
tests /* /build
2
11
tests /build
3
12
tests /tests.pro
13
+ Makefile
14
+ .qmake.stash
15
+ * .qmake.stash
16
+ * qmake.stash
17
+ /.qmake.stash
18
+ * .o
19
+ run-tests.sh
20
+ tests.pro
21
+ /.qmake.stash
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
3
''' generates a tests.pro file by crawling the directory and generating a subdirs
4
- entry for each subdirectory '''
4
+ entry for each subdirectory. Additionally it generates a run script for the tests to get executed,
5
+ assuming the binary produced is named like the directory'''
5
6
6
7
import os
7
8
8
9
with open (os .path .dirname (os .path .realpath (__file__ )) + "/tests.pro" , "w" ) as projectfile :
9
- projectfile .write ("TEMPLATE=subdirs\n SUBDIRS= \\ \n " )
10
- PATH = os .path .dirname (os .path .realpath (__file__ ))
11
- for item in os .listdir (PATH ):
12
- if os .path .isdir (os .path .join (PATH , item )):
13
- projectfile .write (item + " \\ \n " )
10
+ with open (os .path .dirname (os .path .realpath (__file__ )) + "/run-tests.sh" , "w" ) as runscript :
11
+ projectfile .write ("TEMPLATE=subdirs\n SUBDIRS= \\ \n " )
12
+ runscriptContent = "\
13
+ #!/bin/sh\n \
14
+ set -e\n \
15
+ set -x\n \
16
+ if [ ! -z $1 ]; then\n \
17
+ TEST_ROOT=$1\n \
18
+ else\n \
19
+ TEST_ROOT=.\n \
20
+ fi\n "
21
+ runscript .write (runscriptContent )
22
+ PATH = os .path .dirname (os .path .realpath (__file__ ))
23
+ for item in os .listdir (PATH ):
24
+ if os .path .isdir (os .path .join (PATH , item )):
25
+ projectfile .write (item + " \\ \n " )
26
+ runscript .write ("timeout 10s $TEST_ROOT/" +
27
+ item + "/" + item + "\n " )
28
+ os .chmod (os .path .dirname (os .path .realpath (__file__ )) + "/run-tests.sh" , 0o744 )
File renamed without changes.
Original file line number Diff line number Diff line change @@ -4,4 +4,5 @@ int main()
4
4
{
5
5
QString hello (" Hello World!" );
6
6
qDebug () << hello;
7
+ return 0 ;
7
8
}
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments