More work on the test suite
This commit is contained in:
parent
b70a9df716
commit
53c0afce1e
|
@ -1,5 +1,6 @@
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
- test
|
||||||
|
|
||||||
build:sh4-gcc:
|
build:sh4-gcc:
|
||||||
stage: build
|
stage: build
|
||||||
|
@ -8,3 +9,13 @@ build:sh4-gcc:
|
||||||
- source /etc/bash.bashrc
|
- source /etc/bash.bashrc
|
||||||
- make clean
|
- make clean
|
||||||
- make samples
|
- make samples
|
||||||
|
|
||||||
|
test:sh4-gcc:
|
||||||
|
stage: test
|
||||||
|
image: kazade/dreamcast-sdk
|
||||||
|
script:
|
||||||
|
- source /etc/bash.bashrc
|
||||||
|
- make test
|
||||||
|
- lxdream -H -b -e tests/tests.elf | python3 utils/test_parser.py
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
TARGET = tests.elf
|
TARGET = tests.elf
|
||||||
OBJS = test_runner.o
|
OBJS = test_runner.o
|
||||||
|
TESTS := $(shell find . -name \*.h)
|
||||||
TESTS = $(shell find . -name "*.cpp")
|
|
||||||
|
|
||||||
CXXFLAGS := $(CXXFLAGS) -std=c++11
|
CXXFLAGS := $(CXXFLAGS) -std=c++11
|
||||||
|
|
||||||
|
@ -10,12 +9,16 @@ all: rm-elf $(TARGET)
|
||||||
include $(KOS_BASE)/Makefile.rules
|
include $(KOS_BASE)/Makefile.rules
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f $(TARGET) $(OBJS) romdisk.*
|
-rm -f $(TARGET) $(OBJS) romdisk.* test_runner.o test_runner.cpp
|
||||||
|
|
||||||
rm-elf:
|
rm-elf:
|
||||||
-rm -f $(TARGET) romdisk.*
|
-rm -f $(TARGET) romdisk.*
|
||||||
|
|
||||||
test_runner.cpp: $(shell python3 test_generator.py --output=test_runner.cpp $(TESTS))
|
test_runner.cpp:
|
||||||
|
$(shell python3 test_generator.py --output=test_runner.cpp $(TESTS))
|
||||||
|
@echo MY_VAR IS $(TESTS)
|
||||||
|
|
||||||
|
test_runner.o: test_runner.cpp
|
||||||
|
|
||||||
$(TARGET): $(OBJS) romdisk.o
|
$(TARGET): $(OBJS) romdisk.o
|
||||||
kos-c++ -o $(TARGET) $(OBJS) romdisk.o
|
kos-c++ -o $(TARGET) $(OBJS) romdisk.o
|
||||||
|
@ -32,3 +35,4 @@ run: $(TARGET)
|
||||||
dist:
|
dist:
|
||||||
rm -f $(OBJS) romdisk.o romdisk.img
|
rm -f $(OBJS) romdisk.o romdisk.img
|
||||||
$(KOS_STRIP) $(TARGET)
|
$(KOS_STRIP) $(TARGET)
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
VERBOSE = False
|
VERBOSE = True
|
||||||
|
|
||||||
def log_verbose(message):
|
def log_verbose(message):
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
|
@ -165,7 +165,7 @@ def find_tests(files):
|
||||||
|
|
||||||
# If this subclasses TestCase, or it subclasses any of the already found testcase subclasses
|
# If this subclasses TestCase, or it subclasses any of the already found testcase subclasses
|
||||||
# then add it to the list
|
# then add it to the list
|
||||||
if "TestCase" in subclass_names or "SimulantTestCase" in subclass_names or any(x[1] in subclasses[i][2] for x in test_case_subclasses):
|
if "TestCase" in subclass_names or "GLdcTestCase" in subclass_names or any(x[1] in subclasses[i][2] for x in test_case_subclasses):
|
||||||
if subclasses[i] not in test_case_subclasses:
|
if subclasses[i] not in test_case_subclasses:
|
||||||
test_case_subclasses.append(subclasses[i])
|
test_case_subclasses.append(subclasses[i])
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "../utils/test.h"
|
#include "../utils/test.h"
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class NearZClippingTests : gldc::test::GLdcTestCase {
|
class NearZClippingTests : public gldc::test::GLdcTestCase {
|
||||||
|
public:
|
||||||
|
void test_failure() {
|
||||||
|
assert_false(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
18
utils/test_parser.py
Normal file
18
utils/test_parser.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import re
|
||||||
|
import fileinput
|
||||||
|
import sys
|
||||||
|
|
||||||
|
REGEX = "(\d+) tests ([failed|crashed])"
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
for line in sys.stdin:
|
||||||
|
print(line, end="")
|
||||||
|
|
||||||
|
if re.search(REGEX, line):
|
||||||
|
print("DETECTED FAILURES")
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
print("TESTS PASSED!")
|
||||||
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user