VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
RegressionTester.h
1// -----------------------------------------------------------------------------
2// This file is part of VirtualC64
3//
4// Copyright (C) Dirk W. Hoffmann. www.dirkwhoffmann.de
5// This FILE is dual-licensed. You are free to choose between:
6//
7// - The GNU General Public License v3 (or any later version)
8// - The Mozilla Public License v2
9//
10// SPDX-License-Identifier: GPL-3.0-or-later OR MPL-2.0
11// -----------------------------------------------------------------------------
12
13#pragma once
14
15#include "SubComponent.h"
16#include "C64Types.h"
17
18namespace vc64 {
19
20class C64;
21
22class RegressionTester : public SubComponent {
23
24 Descriptions descriptions = {{
25
26 .name = "RegressionTester",
27 .description = "Regression Tester"
28 }};
29
30 // Pixel area ritten to the test image
31 static constexpr isize X1 = 104;
32 static constexpr isize Y1 = 17;
33 static constexpr isize X2 = 488;
34 static constexpr isize Y2 = 291;
35
36public:
37
38 // Filename of the test image
39 string dumpTexturePath = "texture";
40
41 // Pixel area that is written to the test image
42 isize x1 = X1;
43 isize y1 = Y1;
44 isize x2 = X2;
45 isize y2 = Y2;
46
47private:
48
49 // When the emulator exits, this value is returned to the test script
50 u8 retValue = 0;
51
52
53 //
54 // Methods
55 //
56
57public:
58
59 using SubComponent::SubComponent;
60
61 RegressionTester& operator= (const RegressionTester& other) { return *this; }
62
63
64 //
65 // Methods from Serializable
66 //
67
68public:
69
70 template <class T> void serialize(T& worker) { } SERIALIZERS(serialize);
71
72
73 //
74 // Methods from CoreComponent
75 //
76
77public:
78
79 const Descriptions &getDescriptions() const override { return descriptions; }
80
81private:
82
83 void _dump(Category category, std::ostream& os) const override { }
84
85
86 //
87 // Running a regression test
88 //
89
90public:
91
92 // Reverts to factory settings
93 void prepare(C64 &c64, C64Model model);
94
95 // Runs a test case
96 void run(string path);
97
98 // Creates the test image and exits the emulator
99 void dumpTexture(C64 &c64);
100 void dumpTexture(C64 &c64, const string &filename);
101 void dumpTexture(C64 &c64, std::ostream& os);
102
103
104 //
105 // Handling errors
106 //
107
108public:
109
110 // Emulates the debugcart feature (used by VICE tests)
111 void debugcart(u8 value);
112};
113
114}
VirtualC64 project namespace.
Definition CmdQueue.cpp:16